CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
EcalSelectiveReadoutValidation Class Reference

#include <EcalSelectiveReadoutValidation.h>

Inheritance diagram for EcalSelectiveReadoutValidation:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  energiesEb_t
 
struct  energiesEe_t
 

Public Member Functions

void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
 EcalSelectiveReadoutValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalSelectiveReadoutValidation ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &c) override
 Analyzes the event. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Types

typedef EcalRecHit RecHit
 
typedef EcalRecHitCollection RecHitCollection
 
enum  subdet_t { EB, EE }
 distinguishes barral and endcap of ECAL. More...
 

Private Member Functions

template<class T , class U >
void anaDigi (const T &frame, const U &srFlagColl)
 
void anaDigiInit ()
 
void analyzeDataVolume (const edm::Event &e, const edm::EventSetup &es)
 
void analyzeEB (const edm::Event &event, const edm::EventSetup &es)
 
void analyzeEE (const edm::Event &event, const edm::EventSetup &es)
 
void analyzeTP (const edm::Event &event, const edm::EventSetup &es)
 
template<class T >
void checkSrApplication (const edm::Event &event, T &srfs)
 
int cIndex2iEta (int i) const
 
int cIndex2iPhi (int i) const
 
int cIndex2iTtEta (int i) const
 
int cIndex2iTtPhi (int i) const
 
int cIndex2iXY (int iX0) const
 
template<class T >
void compareSrfColl (const edm::Event &event, T &srfFromData, T &computedSrf)
 
void configFirWeights (const std::vector< double > &weightsForZsFIR)
 
std::pair< int, int > dccCh (const DetId &xtalId) const
 
double frame2Energy (const EcalDataFrame &frame) const
 
template<class T >
double frame2EnergyForTp (const T &frame, int offset=0) const
 
double getBytesPerCrystal () const
 
int getCrystalCount (int iDcc, int iDccCh)
 
double getDccEventSize (int iDcc0, double nReadXtals) const
 
double getDccOverhead (subdet_t subdet) const
 
double getDccSrDependentPayload (int iDcc0, double nReadRus, double nReadXtals) const
 
double getEbEventSize (double nReadXtals) const
 
double getEeEventSize (double nReadXtals) const
 
double getL1aRate () const
 
int getRuCount (int iDcc0) const
 
int iEta2cIndex (int iEta) const
 
void initAsciiFile ()
 
int iPhi2cIndex (int iPhi) const
 
int iTtEta2cIndex (int iEta) const
 
int iTtPhi2cIndex (int iPhi) const
 
int iXY2cIndex (int iX) const
 
void printAvailableHists ()
 
void readAllCollections (const edm::Event &e)
 
bool registerHist (const std::string &name, const std::string &title)
 
void selectFedsForLog ()
 
void setTtEtSums (const edm::EventSetup &es, const EBDigiCollection &ebDigis, const EEDigiCollection &eeDigis)
 
void updateL1aRate (const edm::Event &event)
 
EcalTrigTowerDetId readOutUnitOf (const EBDetId &xtalId) const
 
EcalScDetId readOutUnitOf (const EEDetId &xtalId) const
 
MonitorElementbookFloat (DQMStore::IBooker &, const std::string &name)
 
MonitorElementbook1D (DQMStore::IBooker &, const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
 
MonitorElementbook2D (DQMStore::IBooker &, const std::string &name, const std::string &title, int nxbins, double xmin, double xmax, int nybins, double ymin, double ymax)
 
MonitorElementbookProfile (DQMStore::IBooker &, const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
 
MonitorElementbookProfile2D (DQMStore::IBooker &, const std::string &name, const std::string &title, int nbinx, double xmin, double xmax, int nbiny, double ymin, double ymax, const char *option="")
 
void fill (MonitorElement *me, float x)
 
void fill (MonitorElement *me, float x, float yw)
 
void fill (MonitorElement *me, float x, float y, float zw)
 
void fill (MonitorElement *me, float x, float y, float z, float w)
 
int ruGraphX (const EcalScDetId &id) const
 
int ruGraphY (const EcalScDetId &id) const
 
int ruGraphX (const EcalTrigTowerDetId &id) const
 
int ruGraphY (const EcalTrigTowerDetId &id) const
 
int xtalGraphX (const EEDetId &id) const
 
int xtalGraphY (const EEDetId &id) const
 
int xtalGraphX (const EBDetId &id) const
 
int xtalGraphY (const EBDetId &id) const
 
int dccId (const EcalScDetId &detId) const
 
int dccId (const EcalTrigTowerDetId &detId) const
 

Static Private Member Functions

static int dccZsFIR (const EcalDataFrame &frame, const std::vector< int > &firWeights, int firstFIRSample, bool *saturated=0)
 
static std::vector< int > getFIRWeights (const std::vector< double > &normalizedWeights)
 

Private Attributes

bool allHists_
 
std::map< std::string,
std::string > 
availableHistList_
 
bool collNotFoundWarn_
 Switch for collection-not-found warning. More...
 
energiesEb_t ebEnergies [nEbEta][nEbPhi]
 
int ebZsThr_
 
energiesEe_t eeEnergies [nEndcaps][nEeX][nEeY]
 
int eeZsThr_
 
const EcalElectronicsMappingelecMap_
 
int firstFIRSample_
 
std::vector< int > firWeights_
 
std::string histDir_
 
std::set< std::string > histList_
 
int ievt_
 
bool isRuComplete_ [nDccs_][nDccChs_]
 
bool localReco_
 
std::vector< bool > logErrForDccs_
 
bool logSrApplicationErrors_
 
bool logSrpAlgoErrors_
 
MonitorElementmeL1aRate_
 
int nCompleteZS_
 Counter of ZS-flagged RU fully read out. More...
 
int nDroppedFRO_
 Counter of FRO-flagged RU dropped from data. More...
 
int nEb_
 
int nEbFROCnt_
 Counter of EB FRO-flagged RUs. More...
 
int nEbHI_
 
int nEbLI_
 
int nEbZsErrors_
 Counter of EB ZS errors (LI channel below ZS threshold) More...
 
int nEbZsErrorsType1_
 
int nEe_
 
int nEeFROCnt_
 Counter of EE FRO-flagged RUs. More...
 
int nEeHI_
 
int nEeLI_
 
int nEeZsErrors_
 Counter of EE ZS errors (LI channel below ZS threshold) More...
 
int nEeZsErrorsType1_
 
int nHiPerDcc_ [nDccs_]
 
int nHiRuPerDcc_ [nDccs_]
 
int nIncompleteFRO_
 Counter of FRO-flagged RU only partial data. More...
 
int nLiPerDcc_ [nDccs_]
 
int nLiRuPerDcc_ [nDccs_]
 
int nPerDcc_ [nDccs_]
 
int nPerRu_ [nDccs_][nDccChs_]
 
int nRuPerDcc_ [nDccs_]
 
std::string outputFile_
 Output file for histograms. More...
 
bool SkipInnerSC_
 
std::ofstream srApplicationErrorLog_
 Output ascii file for unconsistency between Xtals and RU Flags. More...
 
std::string srApplicationErrorLogFileName_
 
std::ofstream srpAlgoErrorLog_
 Output ascii file for unconsistency on SR flags. More...
 
std::string srpAlgoErrorLogFileName_
 
bool tpInGeV_
 
const
EcalTrigTowerConstituentsMap
triggerTowerMap_
 
double ttEtSums [nTtEta][nTtPhi]
 
bool useEventRate_
 
bool verbose_
 Verbosity switch. More...
 
std::vector< double > weights_
 
bool withEbSimHit_
 
bool withEeSimHit_
 
std::ofstream zsErrorLog_
 File to log ZS and other errors. More...
 
CollHandle< EBDigiCollectionebDigis_
 
CollHandle< EEDigiCollectioneeDigis_
 
CollHandle< EBDigiCollectionebNoZsDigis_
 
CollHandle< EEDigiCollectioneeNoZsDigis_
 
CollHandle< EBSrFlagCollectionebSrFlags_
 
CollHandle< EESrFlagCollectioneeSrFlags_
 
CollHandle< EBSrFlagCollectionebComputedSrFlags_
 
CollHandle< EESrFlagCollectioneeComputedSrFlags_
 
CollHandle< std::vector
< PCaloHit > > 
ebSimHits_
 
CollHandle< std::vector
< PCaloHit > > 
eeSimHits_
 
CollHandle
< EcalTrigPrimDigiCollection
tps_
 
CollHandle< RecHitCollectionebRecHits_
 
CollHandle< RecHitCollectioneeRecHits_
 
CollHandle< FEDRawDataCollectionfedRaw_
 
int64_t tmax
 
int64_t tmin
 
int64_t l1aOfTmin
 
int64_t l1aOfTmax
 
bool l1aRateErr
 
MonitorElementmeDccVol_
 
MonitorElementmeDccLiVol_
 
MonitorElementmeDccHiVol_
 
MonitorElementmeDccVolFromData_
 
MonitorElementmeVol_
 
MonitorElementmeVolB_
 
MonitorElementmeVolE_
 
MonitorElementmeVolBLI_
 
MonitorElementmeVolELI_
 
MonitorElementmeVolLI_
 
MonitorElementmeVolBHI_
 
MonitorElementmeVolEHI_
 
MonitorElementmeVolHI_
 
MonitorElementmeChOcc_
 
MonitorElementmeTp_
 
MonitorElementmeTtf_
 
MonitorElementmeTtfVsTp_
 
MonitorElementmeTtfVsEtSum_
 
MonitorElementmeTpVsEtSum_
 
MonitorElementmeEbRecE_
 
MonitorElementmeEbEMean_
 
MonitorElementmeEbNoise_
 
MonitorElementmeEbSimE_
 
MonitorElementmeEbRecEHitXtal_
 
MonitorElementmeEbRecVsSimE_
 
MonitorElementmeEbNoZsRecVsSimE_
 
MonitorElementmeEeRecE_
 
MonitorElementmeEeEMean_
 
MonitorElementmeEeNoise_
 
MonitorElementmeEeSimE_
 
MonitorElementmeEeRecEHitXtal_
 
MonitorElementmeEeRecVsSimE_
 
MonitorElementmeEeNoZsRecVsSimE_
 
MonitorElementmeFullRoRu_
 
MonitorElementmeZs1Ru_
 
MonitorElementmeForcedRu_
 
MonitorElementmeLiTtf_
 
MonitorElementmeMiTtf_
 
MonitorElementmeHiTtf_
 
MonitorElementmeForcedTtf_
 
MonitorElementmeTpMap_
 
MonitorElementmeFullRoCnt_
 
MonitorElementmeEbFullRoCnt_
 
MonitorElementmeEeFullRoCnt_
 
MonitorElementmeEbLiZsFir_
 
MonitorElementmeEbHiZsFir_
 
MonitorElementmeEbIncompleteRUZsFir_
 
MonitorElementmeEeLiZsFir_
 
MonitorElementmeEeHiZsFir_
 
MonitorElementmeSRFlagsFromData_
 
MonitorElementmeSRFlagsComputed_
 
MonitorElementmeSRFlagsConsistency_
 
MonitorElementmeIncompleteFRO_
 
MonitorElementmeDroppedFRO_
 
MonitorElementmeCompleteZS_
 
MonitorElementmeIncompleteFROMap_
 
MonitorElementmeDroppedFROMap_
 
MonitorElementmeCompleteZSMap_
 
MonitorElementmeIncompleteFRORateMap_
 
MonitorElementmeDroppedFRORateMap_
 
MonitorElementmeCompleteZSRateMap_
 
MonitorElementmeIncompleteFROCnt_
 
MonitorElementmeDroppedFROCnt_
 
MonitorElementmeCompleteZSCnt_
 
MonitorElementmeEbZsErrCnt_
 
MonitorElementmeEeZsErrCnt_
 
MonitorElementmeZsErrCnt_
 
MonitorElementmeEbZsErrType1Cnt_
 
MonitorElementmeEeZsErrType1Cnt_
 
MonitorElementmeZsErrType1Cnt_
 
MonitorElementmeEbFixedPayload_
 
MonitorElementmeEeFixedPayload_
 
MonitorElementmeFixedPayload_
 
bool ebRuActive_ [nEbEta/ebTtEdge][nEbPhi/ebTtEdge]
 
bool eeRuActive_ [nEndcaps][nEeX/scEdge][nEeY/scEdge]
 

Static Private Attributes

static const int ebTtEdge = 5
 Number of crystals along an EB TT. More...
 
static const int kByte_ = 1024
 number of bytes in 1 kByte: More...
 
static const int maxDccId_ = minDccId_ + nDccs_ -1
 
static const int minDccId_ = 1
 
static const unsigned nDccChs_ = 68
 Number of input channels of a DCC. More...
 
static const int nDccRus_ [nDccs_]
 number of RUs for each DCC More...
 
static const unsigned nDccs_ = 54
 Total number of DCCs. More...
 
static const int nEbDccs = 36
 number of DCCs for EB More...
 
static const int nEbEta = 170
 number of crystals along Eta in EB More...
 
static const int nEbPhi = 360
 number of crystals along Phi in EB More...
 
static const int nEbRus = 36*68
 number of RUs for EB More...
 
static const int nEbTtEta = 34
 Number of Trigger Towers in barrel along Eta. More...
 
static const int nEeDccs = 18
 number of DCCs for EE More...
 
static const int nEeRus = 2*(34+32+33+33+32+34+33+34+33)
 number of RUs for EE More...
 
static const int nEeX = 100
 EE crystal grid size along X. More...
 
static const int nEeY = 100
 EE crystal grid size along Y. More...
 
static const int nEndcaps = 2
 number of endcaps More...
 
static const int nMaxXtalPerRu = 25
 Number of crystals per Readout Unit excepted partial SCs. More...
 
static const int nOneEeTtEta = 11
 Number of Trigger Towers in an endcap along Eta. More...
 
static const int nTtEta = 2*nOneEeTtEta + nEbTtEta
 Number of Trigger Towers along Eta. More...
 
static const int nTtPhi = 72
 Number of Trigger Towers along Phi. More...
 
static const double rad2deg = 45./atan(1.)
 Conversion factor from radian to degree. More...
 
static const int scEdge = 5
 Number of crystals along a supercrystal edge. More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 34 of file EcalSelectiveReadoutValidation.h.

Member Typedef Documentation

Definition at line 37 of file EcalSelectiveReadoutValidation.h.

Definition at line 36 of file EcalSelectiveReadoutValidation.h.

Member Enumeration Documentation

distinguishes barral and endcap of ECAL.

Enumerator
EB 
EE 

Definition at line 58 of file EcalSelectiveReadoutValidation.h.

Constructor & Destructor Documentation

EcalSelectiveReadoutValidation::EcalSelectiveReadoutValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 56 of file EcalSelectiveReadoutValidation.cc.

References allHists_, configFirWeights(), edm::EDConsumerBase::consumesCollector(), ebComputedSrFlags_, ebDigis_, ebNoZsDigis_, ebRecHits_, ebSimHits_, ebSrFlags_, ebZsThr_, eeComputedSrFlags_, eeDigis_, eeNoZsDigis_, eeRecHits_, eeSimHits_, eeSrFlags_, eeZsThr_, fedRaw_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), histList_, logSrApplicationErrors_, logSrpAlgoErrors_, outputFile_, CollHandle< T >::setToken(), srApplicationErrorLogFileName_, srpAlgoErrorLogFileName_, tps_, and verbose_.

56  :
57  collNotFoundWarn_(ps.getUntrackedParameter<bool>("warnIfCollectionNotFound", true)),
58  ebDigis_(ps.getParameter<edm::InputTag>("EbDigiCollection"), false,
60  eeDigis_(ps.getParameter<edm::InputTag>("EeDigiCollection"), false,
62  ebNoZsDigis_(ps.getParameter<edm::InputTag>("EbUnsuppressedDigiCollection"),
63  false, false/*collNotFoundWarn_*/),
64  eeNoZsDigis_(ps.getParameter<edm::InputTag>("EeUnsuppressedDigiCollection"),
65  false, false/*collNotFoundWarn_*/),
66  ebSrFlags_(ps.getParameter<edm::InputTag>("EbSrFlagCollection"), false,
68  eeSrFlags_(ps.getParameter<edm::InputTag>("EeSrFlagCollection"), false,
70  ebComputedSrFlags_(ps.getParameter<edm::InputTag>("EbSrFlagFromTTCollection"), false,
71  false/*collNotFoundWarn_*/),
72  eeComputedSrFlags_(ps.getParameter<edm::InputTag>("EeSrFlagFromTTCollection"), false,
73  false/*collNotFoundWarn_*/),
74  ebSimHits_(ps.getParameter<edm::InputTag>("EbSimHitCollection"), false,
75  false/*collNotFoundWarn_*/),
76  eeSimHits_(ps.getParameter<edm::InputTag>("EeSimHitCollection"), false,
77  false/*collNotFoundWarn_*/),
78  tps_(ps.getParameter<edm::InputTag>("TrigPrimCollection"), false,
80  ebRecHits_(ps.getParameter<edm::InputTag>("EbRecHitCollection"), false,
81  false/*collNotFoundWarn_*/),
82  eeRecHits_(ps.getParameter<edm::InputTag>("EeRecHitCollection"), false,
83  false/*collNotFoundWarn_*/),
84  fedRaw_(ps.getParameter<edm::InputTag>("FEDRawCollection"), false,
85  false/*collNotFoundWarn_*/),
86  tmax(0),
88  l1aOfTmin(0),
89  l1aOfTmax(0),
91  localReco_(ps.getParameter<bool>("LocalReco")),
92  weights_(ps.getParameter<vector<double> >("weights")),
93  tpInGeV_(ps.getParameter<bool>("tpInGeV")),
94  firstFIRSample_(ps.getParameter<int>("ecalDccZs1stSample")),
95  useEventRate_(ps.getParameter<bool>("useEventRate")),
96  logErrForDccs_(nDccs_, false),
97  ievt_(0),
98  allHists_(false),
99  histDir_(ps.getParameter<string>("histDir")),
100  withEeSimHit_(false),
101  withEbSimHit_(false){
102 
104  ebDigis_.setToken(collector);
105  eeDigis_.setToken(collector);
106  ebNoZsDigis_.setToken(collector);
107  eeNoZsDigis_.setToken(collector);
108  ebSrFlags_.setToken(collector);
109  eeSrFlags_.setToken(collector);
110  ebComputedSrFlags_.setToken(collector);
111  eeComputedSrFlags_.setToken(collector);
112  ebSimHits_.setToken(collector);
113  eeSimHits_.setToken(collector);
114  tps_.setToken(collector);
115  ebRecHits_.setToken(collector);
116  eeRecHits_.setToken(collector);
117  fedRaw_.setToken(collector);
118 
119  double ebZsThr = ps.getParameter<double>("ebZsThrADCCount");
120  double eeZsThr = ps.getParameter<double>("eeZsThrADCCount");
121 
122  ebZsThr_ = lround(ebZsThr*4);
123  eeZsThr_ = lround(eeZsThr*4);
124 
125  //File to log SRP algorithem inconsistency
127  = ps.getUntrackedParameter<string>("srpAlgoErrorLogFile","");
129 
130  //File to log SRP decision application inconsistency
132  = ps.getUntrackedParameter<string>("srApplicationErrorLogFile","");
134 
135  //FIR ZS weights
136  configFirWeights(ps.getParameter<vector<double> >("dccWeights"));
137 
138  // DQM ROOT output
139  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
140 
141  if(outputFile_.size() != 0){
142  LogInfo("OutputInfo") << " Ecal Digi Task histograms will be saved to '"
143  << outputFile_.c_str() << "'";
144  } else{
145  LogInfo("OutputInfo") << " Ecal Digi Task histograms will NOT be saved";
146  }
147 
148  // verbosity switch
149  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
150 
151  // get hold of back-end interface
152 
153  vector<string>
154  hists(ps.getUntrackedParameter<vector<string> >("histograms",
155  vector<string>(1, "all")));
156 
157  for(vector<string>::iterator it = hists.begin();
158  it!=hists.end(); ++it) histList_.insert(*it);
159  if(histList_.find("all") != histList_.end()) allHists_ = true;
160 
161 }
void configFirWeights(const std::vector< double > &weightsForZsFIR)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
CollHandle< EBDigiCollection > ebNoZsDigis_
CollHandle< EcalTrigPrimDigiCollection > tps_
bool collNotFoundWarn_
Switch for collection-not-found warning.
CollHandle< FEDRawDataCollection > fedRaw_
CollHandle< EESrFlagCollection > eeComputedSrFlags_
CollHandle< EEDigiCollection > eeDigis_
std::string outputFile_
Output file for histograms.
CollHandle< RecHitCollection > eeRecHits_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
CollHandle< EBSrFlagCollection > ebSrFlags_
CollHandle< std::vector< PCaloHit > > eeSimHits_
CollHandle< EESrFlagCollection > eeSrFlags_
CollHandle< std::vector< PCaloHit > > ebSimHits_
CollHandle< EEDigiCollection > eeNoZsDigis_
void setToken(edm::ConsumesCollector &collector)
Definition: CollHandle.h:49
CollHandle< EBDigiCollection > ebDigis_
static const unsigned nDccs_
Total number of DCCs.
const EcalTrigTowerConstituentsMap * triggerTowerMap_
CollHandle< RecHitCollection > ebRecHits_
CollHandle< EBSrFlagCollection > ebComputedSrFlags_
EcalSelectiveReadoutValidation::~EcalSelectiveReadoutValidation ( )

Destructor.

Definition at line 828 of file EcalSelectiveReadoutValidation.cc.

828  {
829 }

Member Function Documentation

template<class T , class U >
void EcalSelectiveReadoutValidation::anaDigi ( const T frame,
const U &  srFlagColl 
)
private

Accumulates statitics for data volume analysis. To be called for each ECAL digi. See anaDigiInit().

Definition at line 1496 of file EcalSelectiveReadoutValidation.cc.

References Reference_intrackfit_cff::barrel, dccCh(), ebRuActive_, ebTtEdge, EcalBarrel, eeRuActive_, Exception, iEta2cIndex(), iPhi2cIndex(), iXY2cIndex(), minDccId_, nEb_, nEbHI_, nEbLI_, nEe_, nEeHI_, nEeLI_, nHiPerDcc_, nHiRuPerDcc_, nLiPerDcc_, nLiRuPerDcc_, nPerDcc_, nPerRu_, nRuPerDcc_, DetId::rawId(), readOutUnitOf(), scEdge, EcalSrFlag::SRF_FULL, DetId::subdetId(), and ecaldqm::zside().

Referenced by analyzeDataVolume().

1497  {
1498  const DetId& xtalId = frame.id();
1499  typedef typename U::key_type RuDetId;
1500  const RuDetId& ruId = readOutUnitOf(frame.id());
1501  typename U::const_iterator srf = srFlagColl.find(ruId);
1502 
1503  bool highInterest = false;
1504  int flag = 0;
1505 
1506  if(srf != srFlagColl.end()){
1507  flag = srf->value() & ~EcalSrFlag::SRF_FORCED_MASK;
1508 
1509  highInterest = (flag == EcalSrFlag::SRF_FULL);
1510 
1511  }
1512 
1513  bool barrel = (xtalId.subdetId()==EcalBarrel);
1514 
1515  pair<int,int> ch = dccCh(xtalId);
1516 
1517  if(barrel){
1518  ++nEb_;
1519  if(highInterest){
1520  ++nEbHI_;
1521  } else{//low interest
1522  ++nEbLI_;
1523  }
1524  int iEta0 = iEta2cIndex(static_cast<const EBDetId&>(xtalId).ieta());
1525  int iPhi0 = iPhi2cIndex(static_cast<const EBDetId&>(xtalId).iphi());
1526  if(!ebRuActive_[iEta0/ebTtEdge][iPhi0/ebTtEdge]){
1527  ++nRuPerDcc_[ch.first-minDccId_];
1528  if(highInterest){
1529  ++nHiRuPerDcc_[ch.first-minDccId_];
1530  } else{
1531  ++nLiRuPerDcc_[ch.first-minDccId_];
1532  }
1533 
1534  ebRuActive_[iEta0/ebTtEdge][iPhi0/ebTtEdge] = true;
1535  }
1536  } else{//endcap
1537  ++nEe_;
1538  if(highInterest){
1539  ++nEeHI_;
1540  } else{//low interest
1541  ++nEeLI_;
1542  }
1543  int iX0 = iXY2cIndex(static_cast<const EEDetId&>(frame.id()).ix());
1544  int iY0 = iXY2cIndex(static_cast<const EEDetId&>(frame.id()).iy());
1545  int iZ0 = static_cast<const EEDetId&>(frame.id()).zside()>0?1:0;
1546 
1547  if(!eeRuActive_[iZ0][iX0/scEdge][iY0/scEdge]){
1548  ++nRuPerDcc_[ch.first-minDccId_];
1549  if(highInterest){
1550  ++nHiRuPerDcc_[ch.first-minDccId_];
1551  } else{
1552  ++nLiRuPerDcc_[ch.first-minDccId_];
1553  }
1554 
1555  eeRuActive_[iZ0][iX0/scEdge][iY0/scEdge] = true;
1556  }
1557  }
1558 
1559  if(ch.second < 1 || ch.second > 68){
1560  throw cms::Exception("EcalSelectiveReadoutValidation")
1561  << "Error in DCC channel retrieval for crystal with detId "
1562  << xtalId.rawId() << "DCC channel out of allowed range [1..68]\n";
1563  }
1564  ++nPerDcc_[ch.first-minDccId_];
1565  ++nPerRu_[ch.first-minDccId_][ch.second-1];
1566  if(highInterest){
1567  ++nHiPerDcc_[ch.first-minDccId_];
1568  } else{//low interest channel
1569  ++nLiPerDcc_[ch.first-minDccId_];
1570  }
1571 }
int zside(DetId const &)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
static const int SRF_FULL
Definition: EcalSrFlag.h:24
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
static const int scEdge
Number of crystals along a supercrystal edge.
Definition: DetId.h:18
static const int ebTtEdge
Number of crystals along an EB TT.
bool ebRuActive_[nEbEta/ebTtEdge][nEbPhi/ebTtEdge]
EcalTrigTowerDetId readOutUnitOf(const EBDetId &xtalId) const
std::pair< int, int > dccCh(const DetId &xtalId) const
bool eeRuActive_[nEndcaps][nEeX/scEdge][nEeY/scEdge]
void EcalSelectiveReadoutValidation::anaDigiInit ( )
private

Initializes statistics accumalator for data volume analysis. To be call at start of each event analysis.

Definition at line 1573 of file EcalSelectiveReadoutValidation.cc.

References ebRuActive_, eeRuActive_, nEb_, nEbHI_, nEbLI_, nEe_, nEeHI_, nEeLI_, nHiPerDcc_, nHiRuPerDcc_, nLiPerDcc_, nLiRuPerDcc_, nPerDcc_, nPerRu_, and nRuPerDcc_.

Referenced by analyzeDataVolume().

1573  {
1574  nEb_ = 0;
1575  nEe_ = 0;
1576  nEeLI_ = 0;
1577  nEeHI_ = 0;
1578  nEbLI_ = 0;
1579  nEbHI_ = 0;
1580  bzero(nPerDcc_, sizeof(nPerDcc_));
1581  bzero(nLiPerDcc_, sizeof(nLiPerDcc_));
1582  bzero(nHiPerDcc_, sizeof(nHiPerDcc_));
1583  bzero(nRuPerDcc_, sizeof(nRuPerDcc_));
1584  bzero(ebRuActive_, sizeof(ebRuActive_));
1585  bzero(eeRuActive_, sizeof(eeRuActive_));
1586  bzero(nPerRu_, sizeof(nPerRu_));
1587  bzero(nLiRuPerDcc_, sizeof(nLiRuPerDcc_));
1588  bzero(nHiRuPerDcc_, sizeof(nHiRuPerDcc_));
1589 }
bool ebRuActive_[nEbEta/ebTtEdge][nEbPhi/ebTtEdge]
bool eeRuActive_[nEndcaps][nEeX/scEdge][nEeY/scEdge]
void EcalSelectiveReadoutValidation::analyze ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

Analyzes the event.

Implements edm::stream::EDAnalyzerBase.

Definition at line 189 of file EcalSelectiveReadoutValidation.cc.

References analyzeDataVolume(), analyzeEB(), analyzeEE(), analyzeTP(), checkSrApplication(), compareSrfColl(), ebComputedSrFlags_, ebNoZsDigis_, ebSimHits_, ebSrFlags_, eeComputedSrFlags_, eeNoZsDigis_, eeSimHits_, eeSrFlags_, fill(), ievt_, meCompleteZSCnt_, meDroppedFROCnt_, meEbFullRoCnt_, meEbZsErrCnt_, meEbZsErrType1Cnt_, meEeFullRoCnt_, meEeZsErrCnt_, meEeZsErrType1Cnt_, meFullRoCnt_, meIncompleteFROCnt_, meZsErrCnt_, meZsErrType1Cnt_, nCompleteZS_, nDroppedFRO_, nEbFROCnt_, nEbZsErrors_, nEbZsErrorsType1_, nEeFROCnt_, nEeZsErrors_, nEeZsErrorsType1_, nIncompleteFRO_, readAllCollections(), selectFedsForLog(), setTtEtSums(), tps_, updateL1aRate(), withEbSimHit_, and withEeSimHit_.

190  {
191 
193 
194  //retrieves event products:
196 
197  withEeSimHit_ = (eeSimHits_->size()!=0);
198  withEbSimHit_ = (ebSimHits_->size()!=0);
199 
200  if(ievt_<10){
201  edm::LogInfo("EcalSrValid") << "Size of TP collection: " << tps_->size() << std::endl
202  << "Size of EB SRF collection read from data: "
203  << ebSrFlags_->size() << std::endl
204  << "Size of EB SRF collection computed from data TTFs: "
205  << ebComputedSrFlags_->size() << std::endl
206  << "Size of EE SRF collection read from data: "
207  << eeSrFlags_->size() << std::endl
208  << "Size of EE SRF collection computed from data TTFs: "
209  << eeComputedSrFlags_->size() << std::endl;
210  }
211 
212  if(ievt_==0){
213  selectFedsForLog(); //note: must be called after readAllCollection
214  }
215 
216  //computes Et sum trigger tower crystals:
218 
219  //Data Volume
221 
222  //EB digis
223  //must be called after analyzeDataVolume because it uses
224  //isRuComplete_ array that this method fills
225  analyzeEB(event, es);
226 
227  //EE digis
228  //must be called after analyzeDataVolume because it uses
229  //isRuComplete_ array that this method fills
230  analyzeEE(event, es);
231 
235 
239 
243 
244  //TP
245  analyzeTP(event, es);
246 
247  if(ebComputedSrFlags_->size()){
249  }
250  if(eeComputedSrFlags_->size()){
252  }
253  nDroppedFRO_ = 0;
254  nIncompleteFRO_ = 0;
255  nCompleteZS_ = 0;
261  ++ievt_;
262 }
CollHandle< EBDigiCollection > ebNoZsDigis_
int nIncompleteFRO_
Counter of FRO-flagged RU only partial data.
CollHandle< EcalTrigPrimDigiCollection > tps_
void analyzeEB(const edm::Event &event, const edm::EventSetup &es)
int nEeZsErrors_
Counter of EE ZS errors (LI channel below ZS threshold)
void analyzeEE(const edm::Event &event, const edm::EventSetup &es)
void setTtEtSums(const edm::EventSetup &es, const EBDigiCollection &ebDigis, const EEDigiCollection &eeDigis)
CollHandle< EESrFlagCollection > eeComputedSrFlags_
void checkSrApplication(const edm::Event &event, T &srfs)
void analyzeDataVolume(const edm::Event &e, const edm::EventSetup &es)
CollHandle< EBSrFlagCollection > ebSrFlags_
void updateL1aRate(const edm::Event &event)
int nCompleteZS_
Counter of ZS-flagged RU fully read out.
CollHandle< std::vector< PCaloHit > > eeSimHits_
int nEeFROCnt_
Counter of EE FRO-flagged RUs.
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
CollHandle< EESrFlagCollection > eeSrFlags_
int nEbFROCnt_
Counter of EB FRO-flagged RUs.
CollHandle< std::vector< PCaloHit > > ebSimHits_
int nEbZsErrors_
Counter of EB ZS errors (LI channel below ZS threshold)
CollHandle< EEDigiCollection > eeNoZsDigis_
int nDroppedFRO_
Counter of FRO-flagged RU dropped from data.
void fill(MonitorElement *me, float x)
void compareSrfColl(const edm::Event &event, T &srfFromData, T &computedSrf)
void analyzeTP(const edm::Event &event, const edm::EventSetup &es)
CollHandle< EBSrFlagCollection > ebComputedSrFlags_
void EcalSelectiveReadoutValidation::analyzeDataVolume ( const edm::Event e,
const edm::EventSetup es 
)
private

Data volume analysis. To be called for each event.

Parameters
eventEDM event
esevent setup

Definition at line 1430 of file EcalSelectiveReadoutValidation.cc.

References a, anaDigi(), anaDigiInit(), b, ebDigis_, ebSrFlags_, eeDigis_, eeSrFlags_, FEDRawDataCollection::FEDData(), fedRaw_, fill(), getBytesPerCrystal(), getCrystalCount(), getDccEventSize(), getDccSrDependentPayload(), getEbEventSize(), getEeEventSize(), isRuComplete_, kByte_, maxDccId_, meDccHiVol_, meDccLiVol_, meDccVol_, meDccVolFromData_, meVol_, meVolB_, meVolBHI_, meVolBLI_, meVolE_, meVolEHI_, meVolELI_, meVolHI_, meVolLI_, minDccId_, nDccRus_, nDccs_, nEb_, nEbHI_, nEbLI_, nEe_, nEeHI_, nEeLI_, nHiPerDcc_, nHiRuPerDcc_, nLiPerDcc_, nLiRuPerDcc_, nPerDcc_, nPerRu_, FEDRawData::size(), and edm::DataFrameContainer::size().

Referenced by analyze().

1431  {
1432 
1433  anaDigiInit();
1434 
1435 
1436  //Complete RU, i.e. RU actually fully readout
1437  for(int iDcc = minDccId_; iDcc <= maxDccId_; ++iDcc){
1438  for(int iCh = 1; iCh < nDccRus_[iDcc-minDccId_]; ++iCh){
1439  isRuComplete_[iDcc-minDccId_][iCh-1]
1440  = (nPerRu_[iDcc-minDccId_][iCh-1]==getCrystalCount(iDcc, iCh));
1441  }
1442  }
1443 
1444 
1445  //Barrel
1446  for (unsigned int digis=0; digis<ebDigis_->size(); ++digis){
1447  EBDataFrame ebdf = (*ebDigis_)[digis];
1448  anaDigi(ebdf, *ebSrFlags_);
1449  }
1450 
1451  // Endcap
1452  for (unsigned int digis=0; digis<eeDigis_->size(); ++digis){
1453  EEDataFrame eedf = (*eeDigis_)[digis];
1454  anaDigi(eedf, *eeSrFlags_);
1455  }
1456 
1457  //histos
1458  for(unsigned iDcc0 = 0; iDcc0 < nDccs_; ++iDcc0){
1459  fill(meDccVol_, iDcc0+1, getDccEventSize(iDcc0, nPerDcc_[iDcc0])/kByte_);
1460  fill(meDccLiVol_, iDcc0+1,
1461  getDccSrDependentPayload(iDcc0, nLiRuPerDcc_[iDcc0],
1462  nLiPerDcc_[iDcc0])/kByte_);
1463  fill(meDccHiVol_, iDcc0+1,
1464  getDccSrDependentPayload(iDcc0, nHiRuPerDcc_[iDcc0],
1465  nHiPerDcc_[iDcc0])/kByte_);
1466  const FEDRawDataCollection& raw = *fedRaw_;
1467  fill(meDccVolFromData_, iDcc0+1,
1468  ((double)raw.FEDData(601+iDcc0).size())/kByte_);
1469  }
1470 
1471 
1472  //low interesest channels:
1473  double a = nEbLI_*getBytesPerCrystal()/kByte_; //getEbEventSize(nEbLI_)/kByte_;
1474  fill(meVolBLI_, a);
1475  double b = nEeLI_*getBytesPerCrystal()/kByte_; //getEeEventSize(nEeLI_)/kByte_;
1476  fill(meVolELI_, b);
1477  fill(meVolLI_, a+b);
1478 
1479  //high interest chanels:
1480  a = nEbHI_*getBytesPerCrystal()/kByte_; //getEbEventSize(nEbHI_)/kByte_;
1481  fill(meVolBHI_, a);
1482  b = nEeHI_*getBytesPerCrystal()/kByte_; //getEeEventSize(nEeHI_)/kByte_;
1483  fill(meVolEHI_, b);
1484  fill(meVolHI_, a+b);
1485 
1486  //any-interest channels:
1487  a = getEbEventSize(nEb_)/kByte_;
1488  fill(meVolB_, a);
1489  b = getEeEventSize(nEe_)/kByte_;
1490  fill(meVolE_, b);
1491  fill(meVol_, a+b);
1492 }
double getDccSrDependentPayload(int iDcc0, double nReadRus, double nReadXtals) const
double getDccEventSize(int iDcc0, double nReadXtals) const
CollHandle< FEDRawDataCollection > fedRaw_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
CollHandle< EEDigiCollection > eeDigis_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
CollHandle< EBSrFlagCollection > ebSrFlags_
void anaDigi(const T &frame, const U &srFlagColl)
CollHandle< EESrFlagCollection > eeSrFlags_
static const int nDccRus_[nDccs_]
number of RUs for each DCC
double getEeEventSize(double nReadXtals) const
static const int kByte_
number of bytes in 1 kByte:
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void fill(MonitorElement *me, float x)
CollHandle< EBDigiCollection > ebDigis_
double getEbEventSize(double nReadXtals) const
static const unsigned nDccs_
Total number of DCCs.
void EcalSelectiveReadoutValidation::analyzeEB ( const edm::Event event,
const edm::EventSetup es 
)
private

ECAL barrel data analysis. To be called for each event.

Parameters
eventEDM event
esevent setup

Definition at line 542 of file EcalSelectiveReadoutValidation.cc.

References assert(), edm::DataFrameContainer::begin(), gather_cfg::cout, dccCh(), dccZsFIR(), ebDigis_, ebEnergies, ebNoZsDigis_, ebRecHits_, ebSimHits_, ebSrFlags_, ebZsThr_, DetId::Ecal, EcalBarrel, edm::DataFrameContainer::end(), PCaloHit::energy(), EcalRecHit::energy(), PV3DBase< T, PVType, FrameType >::eta(), EcalSelectiveReadoutValidation::energiesEb_t::eta, Exception, fill(), plotBeamSpotDB::first, firstFIRSample_, firWeights_, frame2Energy(), EcalSelectiveReadoutValidation::energiesEb_t::gain12, ecalMGPA::gainId(), geometry, edm::EventSetup::get(), CaloSubdetectorGeometry::getGeometry(), i, EBDataFrame::id(), EBSrFlag::id(), PCaloHit::id(), EcalRecHit::id(), EcalTrigTowerDetId::ieta(), EBDetId::ieta(), iEta2cIndex(), EcalTrigTowerDetId::ietaAbs(), ievt_, EcalTrigTowerDetId::iphi(), iPhi2cIndex(), isRuComplete_, localReco_, bookConverter::max, meChOcc_, meEbEMean_, meEbHiZsFir_, meEbLiZsFir_, meEbNoise_, meEbNoZsRecVsSimE_, meEbRecE_, meEbRecEHitXtal_, meEbRecVsSimE_, meEbSimE_, meForcedRu_, meFullRoRu_, meZs1Ru_, nEbEta, nEbFROCnt_, nEbPhi, nEbZsErrors_, nEbZsErrorsType1_, EcalSelectiveReadoutValidation::energiesEb_t::noZsRecE, PV3DBase< T, PVType, FrameType >::phi(), EcalSelectiveReadoutValidation::energiesEb_t::phi, rad2deg, readOutUnitOf(), EcalSelectiveReadoutValidation::energiesEb_t::recE, alignCSCRings::s, edm::second(), EcalSelectiveReadoutValidation::energiesEb_t::simE, EcalSelectiveReadoutValidation::energiesEb_t::simHit, EcalDataFrame::size(), srApplicationErrorLog_, EcalSrFlag::SRF_FORCED_MASK, EcalSrFlag::SRF_FULL, EcalSrFlag::SRF_ZS1, findQualityFiles::v, EcalSrFlag::value(), withEbSimHit_, x, xtalGraphX(), xtalGraphY(), y, and EcalTrigTowerDetId::zside().

Referenced by analyze().

543  {
544 
545  bool eventError = false;
546  nEbZsErrors_ = 0;
547  vector<pair<int,int> > xtalEtaPhi;
548 
549  xtalEtaPhi.reserve(nEbPhi*nEbEta);
550  for(int iEta0=0; iEta0<nEbEta; ++iEta0){
551  for(int iPhi0=0; iPhi0<nEbPhi; ++iPhi0){
553  ebEnergies[iEta0][iPhi0].recE = -numeric_limits<double>::max();
554  ebEnergies[iEta0][iPhi0].simE = 0; //must be zero.
555  ebEnergies[iEta0][iPhi0].simHit = 0;
556  ebEnergies[iEta0][iPhi0].gain12 = false;
557  xtalEtaPhi.push_back(pair<int,int>(iEta0, iPhi0));
558  }
559  }
560 
561  // get the barrel geometry:
562  edm::ESHandle<CaloGeometry> geoHandle;
563 
564  es.get<CaloGeometryRecord>().get(geoHandle);
565  const CaloSubdetectorGeometry *geometry_p
566  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
567  CaloSubdetectorGeometry const& geometry = *geometry_p;
568 
569  //EB unsuppressed digis:
571  it != ebNoZsDigis_->end(); ++it){
572  const EBDataFrame& frame = *it;
573  int iEta0 = iEta2cIndex(static_cast<const EBDetId&>(frame.id()).ieta());
574  int iPhi0 = iPhi2cIndex(static_cast<const EBDetId&>(frame.id()).iphi());
575  if(iEta0<0 || iEta0>=nEbEta){
576  stringstream s;
577  s << "EcalSelectiveReadoutValidation: "
578  << "iEta0 (= " << iEta0 << ") is out of range ("
579  << "[0," << nEbEta -1 << "]\n";
580  throw cms::Exception(s.str());
581  }
582  if(iPhi0<0 || iPhi0>=nEbPhi){
583  stringstream s;
584  s << "EcalSelectiveReadoutValidation: "
585  << "iPhi0 (= " << iPhi0 << ") is out of range ("
586  << "[0," << nEbPhi -1 << "]\n";
587  throw cms::Exception(s.str());
588  }
589 
590  ebEnergies[iEta0][iPhi0].noZsRecE = frame2Energy(frame);
591  ebEnergies[iEta0][iPhi0].gain12 = true;
592  for(int i = 0; i< frame.size(); ++i){
593  const int gain12Code = 0x1;
594  if(frame[i].gainId()!=gain12Code) ebEnergies[iEta0][iPhi0].gain12 = false;
595  }
596 
597  const GlobalPoint xtalPos
598  = geometry.getGeometry(frame.id())->getPosition();
599 
600  ebEnergies[iEta0][iPhi0].phi = rad2deg*((double)xtalPos.phi());
601  ebEnergies[iEta0][iPhi0].eta = xtalPos.eta();
602  } //next non-zs digi
603 
604  //EB sim hits
605  for(vector<PCaloHit>::const_iterator it = ebSimHits_->begin();
606  it != ebSimHits_->end(); ++it){
607  const PCaloHit& simHit = *it;
608  EBDetId detId(simHit.id());
609  int iEta = detId.ieta();
610  int iEta0 =iEta2cIndex(iEta);
611  int iPhi = detId.iphi();
612  int iPhi0 = iPhi2cIndex(iPhi);
613  ebEnergies[iEta0][iPhi0].simE += simHit.energy();
614  ++ebEnergies[iEta0][iPhi0].simHit;
615  }
616 
617  bool crystalShot[nEbEta][nEbPhi];
618  pair<int,int> EBxtalCoor[nEbEta][nEbPhi];
619 
620  for(int iEta0=0; iEta0<nEbEta; ++iEta0){
621  for(int iPhi0=0; iPhi0<nEbPhi; ++iPhi0){
622  crystalShot[iEta0][iPhi0] = false;
623  EBxtalCoor[iEta0][iPhi0] = make_pair(0,0);
624  }
625  }
626 
627  int nEbDigi = 0;
628 
630  it != ebDigis_->end(); ++it){
631  ++nEbDigi;
632  const EBDataFrame& frame = *it;
633  int iEta = static_cast<const EBDetId&>(frame.id()).ieta();
634  int iPhi = static_cast<const EBDetId&>(frame.id()).iphi();
635  int iEta0 = iEta2cIndex(iEta);
636  int iPhi0 = iPhi2cIndex(iPhi);
637  if(iEta0<0 || iEta0>=nEbEta){
638  throw (cms::Exception("EcalSelectiveReadoutValidation")
639  << "iEta0 (= " << iEta0 << ") is out of range ("
640  << "[0," << nEbEta -1 << "]");
641  }
642  if(iPhi0<0 || iPhi0>=nEbPhi){
643  throw (cms::Exception("EcalSelectiveReadoutValidation")
644  << "iPhi0 (= " << iPhi0 << ") is out of range ("
645  << "[0," << nEbPhi -1 << "]");
646  }
647  assert(iEta0>=0 && iEta0<nEbEta);
648  assert(iPhi0>=0 && iPhi0<nEbPhi);
649  if(!crystalShot[iEta0][iPhi0]){
650  crystalShot[iEta0][iPhi0] = true;
651  EBxtalCoor[iEta0][iPhi0] = make_pair(xtalGraphX(frame.id()), xtalGraphY(frame.id()));
652  } else{
653  cout << "Error: several digi for same crystal!";
654  abort();
655  }
656  if(localReco_){
657  ebEnergies[iEta0][iPhi0].recE = frame2Energy(frame);
658  }
659 
660  ebEnergies[iEta0][iPhi0].gain12 = true;
661  for(int i = 0; i< frame.size(); ++i){
662  const int gain12Code = 0x1;
663  if(frame[i].gainId()!=gain12Code){
664  ebEnergies[iEta0][iPhi0].gain12 = false;
665  }
666  }
667 
669  = ebSrFlags_->find(readOutUnitOf(frame.id()));
670 
671  bool highInterest = false;
672 
673  // if(srf == ebSrFlags_->end()){
674  // throw cms::Exception("EcalSelectiveReadoutValidation")
675  // << __FILE__ << ":" << __LINE__ << ": SR flag not found";
676  //}
677 
678  if(srf != ebSrFlags_->end()){
679  highInterest = ((srf->value() & ~EcalSrFlag::SRF_FORCED_MASK)
681  }
682 
683 
684  if(highInterest){
686  } else{
687  int v = dccZsFIR(frame, firWeights_, firstFIRSample_, 0);
688  fill(meEbLiZsFir_, v);
689  if(v < ebZsThr_){
690  eventError = true;
691  ++nEbZsErrors_;
692  pair<int,int> ru = dccCh(frame.id());
693  if(isRuComplete_[ru.first][ru.second-1]) ++nEbZsErrorsType1_;
694  if(nEbZsErrors_ < 3){
695  srApplicationErrorLog_ << event.id() << ", "
696  << "RU " << frame.id() << ", "
697  << "DCC " << ru.first
698  << " Ch : " << ru.second << ": "
699  << "LI channel under ZS threshold.\n";
700  }
701  if(nEbZsErrors_==3){
702  srApplicationErrorLog_ << event.id() << ": "
703  << "more ZS errors for this event...\n";
704  }
705  }
706  }
707  } //next EB digi
708 
709  for(int iEta0=0; iEta0<nEbEta; ++iEta0){
710  for(int iPhi0=0; iPhi0<nEbPhi; ++iPhi0)
711  fill(meChOcc_, EBxtalCoor[iEta0][iPhi0].first, EBxtalCoor[iEta0][iPhi0].second,crystalShot[iEta0][iPhi0] ? 1. : 0.);
712  }
713 
714  if(!localReco_){
716  = ebRecHits_->begin();
717  it != ebRecHits_->end(); ++it){
718  ++nEbDigi;
719  const RecHit& hit = *it;
720  int iEta = static_cast<const EBDetId&>(hit.id()).ieta();
721  int iPhi = static_cast<const EBDetId&>(hit.id()).iphi();
722  int iEta0 = iEta2cIndex(iEta);
723  int iPhi0 = iPhi2cIndex(iPhi);
724  if(iEta0<0 || iEta0>=nEbEta){
725  LogError("EcalSrValid") << "iEta0 (= " << iEta0 << ") is out of range ("
726  << "[0," << nEbEta -1 << "]\n";
727  }
728  if(iPhi0<0 || iPhi0>=nEbPhi){
729  LogError("EcalSrValid") << "iPhi0 (= " << iPhi0 << ") is out of range ("
730  << "[0," << nEbPhi -1 << "]\n";
731  }
732  ebEnergies[iEta0][iPhi0].recE = hit.energy();
733  }
734  }
735 
736  for(unsigned int i=0; i<xtalEtaPhi.size(); ++i){
737  int iEta0 = xtalEtaPhi[i].first;
738  int iPhi0= xtalEtaPhi[i].second;
739  energiesEb_t& energies = ebEnergies[iEta0][iPhi0];
740 
741  double recE = energies.recE;
742  if(recE!=-numeric_limits<double>::max()){//not zero suppressed
743  fill(meEbRecE_, ebEnergies[iEta0][iPhi0].recE);
744  fill(meEbEMean_, ievt_+1, recE);
745  } //not zero suppressed
746 
747  if(withEbSimHit_){
748  if(!energies.simHit){//noise only crystal channel
749  fill(meEbNoise_, energies.noZsRecE);
750  } else{
751  fill(meEbSimE_, energies.simE);
752  fill(meEbRecEHitXtal_, energies.recE);
753  }
754  fill(meEbRecVsSimE_, energies.simE, energies.recE);
755  fill(meEbNoZsRecVsSimE_, energies.simE, energies.noZsRecE);
756  }
757  }
758 
759  int EBZs1RuCount[2][17][72];
760  int EBFullRuCount[2][17][72];
761  int EBForcedRuCount[2][17][72];
762  std::pair<int, int> EBtowerCoor[2][17][72];
763  for(int iZ(0); iZ < 2; iZ++){
764  for(int iEta(0);iEta < 17; iEta++){
765  for(int iPhi(0);iPhi < 72; iPhi++){
766  EBZs1RuCount[iZ][iEta][iPhi] = 0;
767  EBFullRuCount[iZ][iEta][iPhi] = 0;
768  EBForcedRuCount[iZ][iEta][iPhi] = 0;
769  }
770  }
771  }
772 
773  //SRF
774  nEbFROCnt_ = 0;
775  char ebSrfMark[2][17][72];
776  bzero(ebSrfMark, sizeof(ebSrfMark));
777  // int idbg = 0;
779  it != ebSrFlags_->end(); ++it){
780  const EBSrFlag& srf = *it;
781  int iEtaAbs = srf.id().ietaAbs();
782  int iPhi = srf.id().iphi();
783  int iZ = srf.id().zside();
784 
785  // cout << "--> " << ++idbg << iEtaAbs << " " << iPhi << " " << iZ
786  // << " " << srf.id() << "\n";
787 
788  if(iEtaAbs < 1 || iEtaAbs > 17
789  || iPhi < 1 || iPhi > 72) throw cms::Exception("EcalSelectiveReadoutValidation")
790  << "Found a barrel SRF with an invalid det ID: " << srf.id() << ".\n";
791  ++ebSrfMark[iZ>0?1:0][iEtaAbs-1][iPhi-1];
792  if(ebSrfMark[iZ>0?1:0][iEtaAbs-1][iPhi-1] > 1) throw cms::Exception("EcalSelectiveReadoutValidation")
793  << "Duplicate SRF for RU " << srf.id() << ".\n";
794 
795  EBtowerCoor[iZ > 0 ? 1 : 0][iEtaAbs - 1][iPhi - 1] = std::pair<int, int>(srf.id().ieta(), srf.id().iphi());
796 
797  int flag = srf.value() & ~EcalSrFlag::SRF_FORCED_MASK;
798  if(flag == EcalSrFlag::SRF_ZS1){
799  EBZs1RuCount[iZ>0?1:0][iEtaAbs-1][iPhi-1] +=1;
800  }
801  if(flag == EcalSrFlag::SRF_FULL){
802  EBFullRuCount[iZ>0?1:0][iEtaAbs-1][iPhi-1] +=1;
803  ++nEbFROCnt_;
804  }
806  EBForcedRuCount[iZ>0?1:0][iEtaAbs-1][iPhi-1] +=1;
807  }
808  }
809  for(int iZ(0); iZ < 2; iZ++){
810  for(int iEta(0);iEta < 17; iEta++){
811  for(int iPhi(0);iPhi < 72; iPhi++){
812  float x(EBtowerCoor[iZ][iEta][iPhi].first);
813  float y(EBtowerCoor[iZ][iEta][iPhi].second);
814  fill(meZs1Ru_, x, y, EBZs1RuCount[iZ][iEta][iPhi]);
815  fill(meFullRoRu_, x, y, EBFullRuCount[iZ][iEta][iPhi]);
816  fill(meForcedRu_, x, y, EBForcedRuCount[iZ][iEta][iPhi]);
817  }
818  }
819  }
820 
821  if(eventError) srApplicationErrorLog_ << event.id()
822  << ": " << nEbZsErrors_
823  << " ZS-flagged EB channels under "
824  "the ZS threshold, whose " << nEbZsErrorsType1_
825  << " in a complete RU.\n";
826 }
int i
Definition: DBlmapReader.cc:9
CollHandle< EBDigiCollection > ebNoZsDigis_
int value() const
Definition: EcalSrFlag.h:44
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
key_type id() const
Definition: EBDataFrame.h:31
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
int xtalGraphX(const EEDetId &id) const
int gainId(sample_type sample)
get the gainId (2 bits)
static const int nEbPhi
number of crystals along Phi in EB
static const int SRF_FORCED_MASK
Definition: EcalSrFlag.h:29
static const double rad2deg
Conversion factor from radian to degree.
double energy() const
Definition: PCaloHit.h:29
int simHit
energy reconstructed from zero-suppressed digi
assert(m_qm.get())
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< EBSrFlag >::const_iterator const_iterator
const_iterator begin() const
int size() const
Definition: EcalDataFrame.h:26
int ieta() const
get the tower ieta
int zside() const
get the z-side of the tower (1/-1)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
static const int nEbEta
number of crystals along Eta in EB
U second(std::pair< T, U > const &p)
int xtalGraphY(const EEDetId &id) const
int ietaAbs() const
get the absolute value of the tower ieta
CollHandle< EBSrFlagCollection > ebSrFlags_
static const int SRF_FULL
Definition: EcalSrFlag.h:24
static int dccZsFIR(const EcalDataFrame &frame, const std::vector< int > &firWeights, int firstFIRSample, bool *saturated=0)
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51
unsigned int id() const
Definition: PCaloHit.h:43
static const int SRF_ZS1
Definition: EcalSrFlag.h:18
int nEbFROCnt_
Counter of EB FRO-flagged RUs.
CollHandle< std::vector< PCaloHit > > ebSimHits_
int nEbZsErrors_
Counter of EB ZS errors (LI channel below ZS threshold)
double recE
energy reconstructed from unsuppressed digi
int iphi() const
get the tower iphi
const T & get() const
Definition: EventSetup.h:56
EcalTrigTowerDetId readOutUnitOf(const EBDetId &xtalId) const
const EcalTrigTowerDetId & id() const
Definition: EBSrFlag.h:36
const_iterator end() const
T eta() const
Definition: PV3DBase.h:76
ESHandle< TrackerGeometry > geometry
tuple cout
Definition: gather_cfg.py:145
void fill(MonitorElement *me, float x)
std::pair< int, int > dccCh(const DetId &xtalId) const
double frame2Energy(const EcalDataFrame &frame) const
CollHandle< EBDigiCollection > ebDigis_
CollHandle< RecHitCollection > ebRecHits_
void EcalSelectiveReadoutValidation::analyzeEE ( const edm::Event event,
const edm::EventSetup es 
)
private

ECAL endcap data analysis. To be called for each event.

Parameters
eventEDM event
esevent setup

Definition at line 265 of file EcalSelectiveReadoutValidation.cc.

References edm::DataFrameContainer::begin(), gather_cfg::cout, dccCh(), dccZsFIR(), DetId::Ecal, EcalEndcap, eeDigis_, eeEnergies, eeNoZsDigis_, eeRecHits_, eeSimHits_, eeSrFlags_, eeZsThr_, edm::DataFrameContainer::end(), PCaloHit::energy(), EcalRecHit::energy(), PV3DBase< T, PVType, FrameType >::eta(), EcalSelectiveReadoutValidation::energiesEe_t::eta, Exception, fill(), plotBeamSpotDB::first, firstFIRSample_, firWeights_, frame2Energy(), EcalSelectiveReadoutValidation::energiesEe_t::gain12, ecalMGPA::gainId(), geometry, edm::EventSetup::get(), CaloSubdetectorGeometry::getGeometry(), i, EEDataFrame::id(), EESrFlag::id(), PCaloHit::id(), EcalRecHit::id(), ievt_, isRuComplete_, EcalScDetId::ix(), EEDetId::ix(), iXY2cIndex(), EcalScDetId::iy(), EEDetId::iy(), localReco_, bookConverter::max, meChOcc_, meEeEMean_, meEeHiZsFir_, meEeLiZsFir_, meEeNoise_, meEeNoZsRecVsSimE_, meEeRecE_, meEeRecEHitXtal_, meEeRecVsSimE_, meEeSimE_, meForcedRu_, meFullRoRu_, meZs1Ru_, nEeFROCnt_, nEeX, nEeY, nEeZsErrors_, nEeZsErrorsType1_, nEndcaps, EcalSelectiveReadoutValidation::energiesEe_t::noZsRecE, PV3DBase< T, PVType, FrameType >::phi(), EcalSelectiveReadoutValidation::energiesEe_t::phi, rad2deg, readOutUnitOf(), EcalSelectiveReadoutValidation::energiesEe_t::recE, edm::second(), EcalSelectiveReadoutValidation::energiesEe_t::simE, EcalSelectiveReadoutValidation::energiesEe_t::simHit, EcalDataFrame::size(), edm::DataFrameContainer::size(), srApplicationErrorLog_, EcalSrFlag::SRF_FORCED_MASK, EcalSrFlag::SRF_FULL, EcalSrFlag::SRF_ZS1, findQualityFiles::v, EcalSrFlag::value(), withEeSimHit_, xtalGraphX(), xtalGraphY(), EcalScDetId::zside(), EEDetId::zside(), and ecaldqm::zside().

Referenced by analyze().

266  {
267  bool eventError = false;
268  nEeZsErrors_ = 0;
269 
270  for(int iZ0=0; iZ0<nEndcaps; ++iZ0){
271  for(int iX0=0; iX0<nEeX; ++iX0){
272  for(int iY0=0; iY0<nEeY; ++iY0){
273  eeEnergies[iZ0][iX0][iY0].noZsRecE = -numeric_limits<double>::max();
274  eeEnergies[iZ0][iX0][iY0].recE = -numeric_limits<double>::max();
275  eeEnergies[iZ0][iX0][iY0].simE = 0; //must be set to zero.
276  eeEnergies[iZ0][iX0][iY0].simHit = 0;
277  eeEnergies[iZ0][iX0][iY0].gain12 = false;
278  }
279  }
280  }
281 
282  // gets the endcap geometry:
283  edm::ESHandle<CaloGeometry> geoHandle;
284  es.get<CaloGeometryRecord>().get(geoHandle);
285  const CaloSubdetectorGeometry *geometry_p
286  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
287  CaloSubdetectorGeometry const& geometry = *geometry_p;
288 
289  //EE unsupressed digis:
290  for (unsigned int digis=0; digis<eeNoZsDigis_->size(); ++digis){
291 
292  EEDataFrame frame = (*eeNoZsDigis_)[digis];
293  int iX0 = iXY2cIndex(frame.id().ix());
294  int iY0 = iXY2cIndex(frame.id().iy());
295  int iZ0 = frame.id().zside()>0?1:0;
296 
297  if(iX0<0 || iX0>=nEeX){
298  edm::LogError("EcalSrValid") << "iX0 (= " << iX0 << ") is out of range ("
299  << "[0," << nEeX -1 << "]\n";
300  }
301  if(iY0<0 || iY0>=nEeY){
302  edm::LogError("EcalSrValid") << "iY0 (= " << iY0 << ") is out of range ("
303  << "[0," << nEeY -1 << "]\n";
304  }
305  // cout << "EE no ZS energy computation..." ;
306  eeEnergies[iZ0][iX0][iY0].noZsRecE = frame2Energy(frame);
307 
308  eeEnergies[iZ0][iX0][iY0].gain12 = true;
309  for(int i = 0; i< frame.size(); ++i){
310  const int gain12Code = 0x1;
311  if(frame[i].gainId()!=gain12Code) eeEnergies[iZ0][iX0][iY0].gain12 = false;
312  }
313 
314  const GlobalPoint xtalPos
315  = geometry.getGeometry(frame.id())->getPosition();
316 
317  eeEnergies[iZ0][iX0][iY0].phi = rad2deg*((double)xtalPos.phi());
318  eeEnergies[iZ0][iX0][iY0].eta = xtalPos.eta();
319  }
320 
321  //EE rec hits:
322  if(!localReco_){
324  = eeRecHits_->begin();
325  it != eeRecHits_->end(); ++it){
326  const RecHit& hit = *it;
327  int iX0 = iXY2cIndex(static_cast<const EEDetId&>(hit.id()).ix());
328  int iY0 = iXY2cIndex(static_cast<const EEDetId&>(hit.id()).iy());
329  int iZ0 = static_cast<const EEDetId&>(hit.id()).zside()>0?1:0;
330 
331  if(iX0<0 || iX0>=nEeX){
332  LogError("EcalSrValid") << "iX0 (= " << iX0 << ") is out of range ("
333  << "[0," << nEeX -1 << "]\n";
334  }
335  if(iY0<0 || iY0>=nEeY){
336  LogError("EcalSrValid") << "iY0 (= " << iY0 << ") is out of range ("
337  << "[0," << nEeY -1 << "]\n";
338  }
339  // cout << "EE no ZS energy computation..." ;
340  eeEnergies[iZ0][iX0][iY0].recE = hit.energy();
341  }
342  }
343 
344  //EE sim hits:
345  for(vector<PCaloHit>::const_iterator it = eeSimHits_->begin();
346  it != eeSimHits_->end(); ++it){
347  const PCaloHit& simHit = *it;
348  EEDetId detId(simHit.id());
349  int iX = detId.ix();
350  int iX0 =iXY2cIndex(iX);
351  int iY = detId.iy();
352  int iY0 = iXY2cIndex(iY);
353  int iZ0 = detId.zside()>0?1:0;
354  eeEnergies[iZ0][iX0][iY0].simE += simHit.energy();
355  ++eeEnergies[iZ0][iX0][iY0].simHit;
356  }
357 
358  bool EEcrystalShot[nEeX][nEeY][2];
359  pair<int,int> EExtalCoor[nEeX][nEeY][2];
360 
361  for(int iEeZ=0; iEeZ<2; ++iEeZ){
362  for(int iEeX=0; iEeX<nEeX; ++iEeX){
363  for(int iEeY=0; iEeY<nEeY; ++iEeY){
364  EEcrystalShot[iEeX][iEeY][iEeZ] = false;
365  EExtalCoor[iEeX][iEeY][iEeZ] = make_pair(0,0);
366  }
367  }
368  }
369 
370  //EE suppressed digis
372  it != eeDigis_->end(); ++it){
373  const EEDataFrame& frame = *it;
374  int iX0 = iXY2cIndex(static_cast<const EEDetId&>(frame.id()).ix());
375  int iY0 = iXY2cIndex(static_cast<const EEDetId&>(frame.id()).iy());
376  int iZ0 = static_cast<const EEDetId&>(frame.id()).zside()>0?1:0;
377  if(iX0<0 || iX0>=nEeX){
378  LogError("EcalSrValid") << "iX0 (= " << iX0 << ") is out of range ("
379  << "[0," << nEeX -1 << "]\n";
380  }
381  if(iY0<0 || iY0>=nEeY){
382  LogError("EcalSrValid") << "iY0 (= " << iY0 << ") is out of range ("
383  << "[0," << nEeY -1 << "]\n";
384  }
385 
386  if(!EEcrystalShot[iX0][iY0][iZ0]){
387  EEcrystalShot[iX0][iY0][iZ0] = true;
388  EExtalCoor[iX0][iY0][iZ0] = make_pair(xtalGraphX(frame.id()), xtalGraphY(frame.id()));
389  } else{
390  cout << "Error: several digi for same crystal!";
391  abort();
392  }
393 
394  if(localReco_){
395  eeEnergies[iZ0][iX0][iY0].recE = frame2Energy(frame);
396  }
397 
398  eeEnergies[iZ0][iX0][iY0].gain12 = true;
399  for(int i = 0; i< frame.size(); ++i){
400  const int gain12Code = 0x1;
401  if(frame[i].gainId()!=gain12Code){
402  eeEnergies[iZ0][iX0][iY0].gain12 = false;
403  }
404  }
405 
407  = eeSrFlags_->find(readOutUnitOf(frame.id()));
408 
409  bool highInterest = false;
410 
411 
412  if(srf==eeSrFlags_->end()) continue;
413 
414  if(srf!=eeSrFlags_->end()){
415  highInterest = ((srf->value() & ~EcalSrFlag::SRF_FORCED_MASK)
417  }
418 
419  if(highInterest){
421  } else{
422  int v = dccZsFIR(frame, firWeights_, firstFIRSample_, 0);
423  fill(meEeLiZsFir_, v);
424  if(v < eeZsThr_){
425  eventError = true;
426  ++nEeZsErrors_;
427  pair<int,int> ru = dccCh(frame.id());
428  if(isRuComplete_[ru.first][ru.second-1]) ++nEeZsErrorsType1_;
429  if(nEeZsErrors_ < 3){
430  srApplicationErrorLog_ << event.id() << ", "
431  << "RU " << frame.id() << ", "
432  << "DCC " << ru.first
433  << " Ch : " << ru.second << ": "
434  << "LI channel under ZS threshold.\n";
435  }
436  if(nEeZsErrors_==3){
437  srApplicationErrorLog_ << event.id() << ": "
438  << "more ZS errors for this event...\n";
439  }
440  }
441  }
442  } //next ZS digi.
443 
444  for(int iEeZ=0; iEeZ<2; ++iEeZ){
445  for(int iEeX=0; iEeX<nEeX; ++iEeX){
446  for(int iEeY=0; iEeY<nEeY; ++iEeY){
447  fill(meChOcc_, EExtalCoor[iEeX][iEeY][iEeZ].first, EExtalCoor[iEeX][iEeY][iEeZ].second,EEcrystalShot[iEeX][iEeY][iEeZ] ? 1 : 0);
448  }
449  }
450  }
451 
452  for(int iZ0=0; iZ0<nEndcaps; ++iZ0){
453  for(int iX0=0; iX0<nEeX; ++iX0){
454  for(int iY0=0; iY0<nEeY; ++iY0){
455  double recE = eeEnergies[iZ0][iX0][iY0].recE;
456  if(recE==-numeric_limits<double>::max()) continue; //not a crystal or ZS
457  fill(meEeRecE_, eeEnergies[iZ0][iX0][iY0].recE);
458 
459  fill(meEeEMean_, ievt_+1,
460  eeEnergies[iZ0][iX0][iY0].recE);
461 
462  if(withEeSimHit_){
463  if(!eeEnergies[iZ0][iX0][iY0].simHit){//noise only crystal channel
464  fill(meEeNoise_, eeEnergies[iZ0][iX0][iY0].noZsRecE);
465  } else{
466  fill(meEeSimE_, eeEnergies[iZ0][iX0][iY0].simE);
467  fill(meEeRecEHitXtal_, eeEnergies[iZ0][iX0][iY0].recE);
468  }
469  fill(meEeRecVsSimE_, eeEnergies[iZ0][iX0][iY0].simE,
470  eeEnergies[iZ0][iX0][iY0].recE);
471  fill(meEeNoZsRecVsSimE_, eeEnergies[iZ0][iX0][iY0].simE,
472  eeEnergies[iZ0][iX0][iY0].noZsRecE);
473  }
474  }
475  }
476  }
477 
478  int EEZs1RuCount[2][20][20];
479  int EEFullRuCount[2][20][20];
480  int EEForcedRuCount[2][20][20];
481  for(int iZ(0); iZ < 2; iZ++){
482  for(int iX(0);iX < 20; iX++){
483  for(int iY(0);iY < 20; iY++){
484  EEZs1RuCount[iZ][iX][iY] = 0;
485  EEFullRuCount[iZ][iX][iY] = 0;
486  EEForcedRuCount[iZ][iX][iY] = 0;
487  }
488  }
489  }
490 
491  nEeFROCnt_ = 0;
492  char eeSrfMark[2][20][20];
493  bzero(eeSrfMark, sizeof(eeSrfMark));
494  //Filling RU histo
496  it != eeSrFlags_->end(); ++it){
497  const EESrFlag& srf = *it;
498  // srf.id() is EcalScDetId; 1 <= ix <= 20 1 <= iy <= 20
499  int iX = srf.id().ix();
500  int iY = srf.id().iy();
501  int zside = srf.id().zside(); //-1 for EE-, +1 for EE+
502  if(iX<1 || iY > 100) throw cms::Exception("EcalSelectiveReadoutValidation")
503  << "Found an endcap SRF with an invalid det ID: " << srf.id() << ".\n";
504  ++eeSrfMark[zside>0?1:0][iX-1][iY-1];
505  if(eeSrfMark[zside>0?1:0][iX-1][iY-1] > 1) throw cms::Exception("EcalSelectiveReadoutValidation")
506  << "Duplicate SRF for supercrystal " << srf.id() << ".\n";
507  int flag = srf.value() & ~EcalSrFlag::SRF_FORCED_MASK;
508  if(flag == EcalSrFlag::SRF_ZS1){
509  EEZs1RuCount[zside>0?1:0][iX-1][iY-1] += 1;
510  }
511 
512  if(flag == EcalSrFlag::SRF_FULL){
513  EEFullRuCount[zside>0?1:0][iX-1][iY-1] += 1;
514  ++nEeFROCnt_;
515  }
516 
518  EEForcedRuCount[zside>0?1:0][iX-1][iY-1] += 1;
519  }
520  }
521  for(int iZ(0); iZ < 2; iZ++){
522  int xOffset(iZ == 0 ? -40 : 20);
523  for(int iX(0);iX < 20; iX++){
524  for(int iY(0);iY < 20; iY++){
525  int GraphX = (iX + 1)+ xOffset;
526  int GraphY = (iY+1);
527  fill(meZs1Ru_, GraphX, GraphY, EEZs1RuCount[iZ][iX][iY]);
528  fill(meFullRoRu_, GraphX, GraphY, EEFullRuCount[iZ][iX][iY]);
529  fill(meForcedRu_, GraphX, GraphY, EEForcedRuCount[iZ][iX][iY]);
530  }
531  }
532  }
533 
534  if(eventError) srApplicationErrorLog_ << event.id()
535  << ": " << nEeZsErrors_
536  << " ZS-flagged EE channels under "
537  "the ZS threshold, whose " << nEeZsErrorsType1_
538  << " in a complete RU.\n";
539 } //end of analyzeEE
int i
Definition: DBlmapReader.cc:9
int value() const
Definition: EcalSrFlag.h:44
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
int ix() const
Definition: EEDetId.h:76
static const int nEeX
EE crystal grid size along X.
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
int xtalGraphX(const EEDetId &id) const
int gainId(sample_type sample)
get the gainId (2 bits)
static const int SRF_FORCED_MASK
Definition: EcalSrFlag.h:29
static const double rad2deg
Conversion factor from radian to degree.
energiesEe_t eeEnergies[nEndcaps][nEeX][nEeY]
double energy() const
Definition: PCaloHit.h:29
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< EcalRecHit >::const_iterator const_iterator
int simHit
energy reconstructed from zero-suppressed digi
int nEeZsErrors_
Counter of EE ZS errors (LI channel below ZS threshold)
const_iterator begin() const
int zside(DetId const &)
int size() const
Definition: EcalDataFrame.h:26
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
U second(std::pair< T, U > const &p)
int xtalGraphY(const EEDetId &id) const
CollHandle< EEDigiCollection > eeDigis_
CollHandle< RecHitCollection > eeRecHits_
int ix() const
Definition: EcalScDetId.h:71
int zside() const
Definition: EEDetId.h:70
static const int SRF_FULL
Definition: EcalSrFlag.h:24
CollHandle< std::vector< PCaloHit > > eeSimHits_
static int dccZsFIR(const EcalDataFrame &frame, const std::vector< int > &firWeights, int firstFIRSample, bool *saturated=0)
int iy() const
Definition: EEDetId.h:82
int nEeFROCnt_
Counter of EE FRO-flagged RUs.
unsigned int id() const
Definition: PCaloHit.h:43
int iy() const
Definition: EcalScDetId.h:77
static const int SRF_ZS1
Definition: EcalSrFlag.h:18
key_type id() const
Definition: EEDataFrame.h:28
CollHandle< EESrFlagCollection > eeSrFlags_
const EcalScDetId & id() const
Definition: EESrFlag.h:37
const T & get() const
Definition: EventSetup.h:56
int zside() const
Definition: EcalScDetId.h:65
EcalTrigTowerDetId readOutUnitOf(const EBDetId &xtalId) const
CollHandle< EEDigiCollection > eeNoZsDigis_
double recE
energy reconstructed from unsuppressed digi
const_iterator end() const
T eta() const
Definition: PV3DBase.h:76
ESHandle< TrackerGeometry > geometry
tuple cout
Definition: gather_cfg.py:145
void fill(MonitorElement *me, float x)
std::pair< int, int > dccCh(const DetId &xtalId) const
double frame2Energy(const EcalDataFrame &frame) const
static const int nEeY
EE crystal grid size along Y.
static const int nEndcaps
number of endcaps
void EcalSelectiveReadoutValidation::analyzeTP ( const edm::Event event,
const edm::EventSetup es 
)
private

Trigger primitive analysis. To be called for each event.

Parameters
eventEDM event
esevent setup

Definition at line 1305 of file EcalSelectiveReadoutValidation.cc.

References cIndex2iTtEta(), cIndex2iTtPhi(), DetId::Ecal, EcalBarrel, EcalEndcap, fill(), edm::EventSetup::get(), MonitorElement::getTProfile(), i, iTtEta2cIndex(), iTtPhi2cIndex(), lumiPlot::lut, meForcedTtf_, meHiTtf_, meLiTtf_, meMiTtf_, meTp_, meTpMap_, meTpVsEtSum_, meTtf_, meTtfVsEtSum_, meTtfVsTp_, nTtEta, nTtPhi, edm::ESHandle< class >::product(), ecaldqm::towerId(), tpInGeV_, tps_, and ttEtSums.

Referenced by analyze().

1306  {
1307  int TTFlagCount[8];
1308  int LiTTFlagCount[nTtEta][nTtPhi];
1309  int MiTTFlagCount[nTtEta][nTtPhi];
1310  int HiTTFlagCount[nTtEta][nTtPhi];
1311  for(int iTTFlag(0);iTTFlag <8; iTTFlag++){
1312  TTFlagCount[iTTFlag]=0;
1313  }
1314  for(int iTtEta(0); iTtEta < nTtEta; iTtEta++){
1315  for(int iTtPhi(0); iTtPhi < nTtPhi; iTtPhi++){
1316  LiTTFlagCount[iTtEta][iTtPhi] = 0;
1317  MiTTFlagCount[iTtEta][iTtPhi] = 0;
1318  HiTTFlagCount[iTtEta][iTtPhi] = 0;
1319  }
1320  }
1321  int tpEtCount[100];
1322  for(int iEt(0);iEt < 100; iEt++){
1323  tpEtCount[iEt] = 0;
1324  }
1325 
1327  es.get<EcalTPGPhysicsConstRcd>().get( physHandle );
1328  const EcalTPGPhysicsConstMap & physMap = physHandle.product()->getMap() ;
1329 
1330  edm::ESHandle<EcalTPGLutGroup> lutGrpHandle;
1331  es.get<EcalTPGLutGroupRcd>().get( lutGrpHandle );
1332  const EcalTPGGroups::EcalTPGGroupsMap & lutGrpMap = lutGrpHandle.product()->getMap() ;
1333 
1334  edm::ESHandle<EcalTPGLutIdMap> lutMapHandle;
1335  es.get<EcalTPGLutIdMapRcd>().get( lutMapHandle );
1336  const EcalTPGLutIdMap::EcalTPGLutMap & lutMap = lutMapHandle.product()->getMap() ;
1337 
1338  EcalTPGPhysicsConstMapIterator ebItr(physMap.find(DetId(DetId::Ecal,EcalBarrel).rawId()));
1339  double lsb10bitsEB(ebItr == physMap.end() ? 0. : ebItr->second.EtSat / 1024.);
1340  EcalTPGPhysicsConstMapIterator eeItr(physMap.find(DetId(DetId::Ecal,EcalEndcap).rawId()));
1341  double lsb10bitsEE(eeItr == physMap.end() ? 0. : eeItr->second.EtSat / 1024.);
1342 
1343  for(EcalTrigPrimDigiCollection::const_iterator it = tps_->begin(); it != tps_->end(); ++it){
1344 
1345  double tpEt;
1346  if(tpInGeV_){
1347  EcalTrigTowerDetId const& towerId(it->id());
1348  unsigned int ADC = it->compressedEt();
1349 
1350  double lsb10bits(0.);
1351  if(towerId.subDet() == EcalBarrel) lsb10bits = lsb10bitsEB;
1352  else if(towerId.subDet() == EcalEndcap) lsb10bits = lsb10bitsEE;
1353 
1354  int tpg10bits = 0 ;
1355  EcalTPGGroups::EcalTPGGroupsMapItr itgrp = lutGrpMap.find(towerId.rawId()) ;
1356  uint32_t lutGrp = 999 ;
1357  if (itgrp != lutGrpMap.end()) lutGrp = itgrp->second ;
1358 
1359  EcalTPGLutIdMap::EcalTPGLutMapItr itLut = lutMap.find(lutGrp) ;
1360  if (itLut != lutMap.end()) {
1361  const unsigned int * lut = (itLut->second).getLut() ;
1362  for (unsigned int i=0 ; i<1024 ; i++)
1363  if (ADC == (0xff & lut[i])) {
1364  tpg10bits = i ;
1365  break ;
1366  }
1367  }
1368 
1369  tpEt = lsb10bits * tpg10bits;
1370  }
1371  else{
1372  tpEt = it->compressedEt();
1373  }
1374  int iEta = it->id().ieta();
1375  int iEta0 = iTtEta2cIndex(iEta);
1376  int iPhi = it->id().iphi();
1377  int iPhi0 = iTtPhi2cIndex(iPhi);
1378  double etSum = ttEtSums[iEta0][iPhi0];
1379 
1380  int iE = meTp_->getTProfile()->FindFixBin(tpEt);
1381  if ((iE >= 0) && (iE < 100)) {
1382  ++tpEtCount[iE];
1383  } else {
1384  // FindFixBin might return an overflow bin (outside tpEtCount range).
1385  // To prevent a memory overflow / segfault, these values are ignored.
1386  //std::cout << "EcalSelectiveReadoutValidation: Invalid iE value: " << iE << std::endl;
1387  }
1388 
1389  fill(meTpVsEtSum_, etSum, tpEt);
1390  ++TTFlagCount[it->ttFlag()];
1391  if((it->ttFlag() & 0x3) == 0){
1392  LiTTFlagCount[iEta0][iPhi0] += 1;
1393  }
1394  else if((it->ttFlag() & 0x3) == 1){
1395  MiTTFlagCount[iEta0][iPhi0] += 1;
1396  }
1397  else if((it->ttFlag() & 0x3) == 3){
1398  HiTTFlagCount[iEta0][iPhi0] += 1;
1399  }
1400  if((it->ttFlag() & 0x4)){
1401  fill(meForcedTtf_, iEta, iPhi);
1402  }
1403 
1404  fill(meTtfVsTp_, tpEt, it->ttFlag());
1405  fill(meTtfVsEtSum_, etSum, it->ttFlag());
1406  fill(meTpMap_, iEta, iPhi, tpEt, 1.);
1407  }
1408 
1409  for(int ittflag(0); ittflag < 8; ittflag++){
1410  fill(meTtf_, ittflag, TTFlagCount[ittflag]);
1411  }
1412  for(int iTtEta(0); iTtEta < nTtEta; iTtEta++){
1413  for(int iTtPhi(0); iTtPhi < nTtPhi; iTtPhi++){
1414  fill(meLiTtf_, cIndex2iTtEta(iTtEta), cIndex2iTtPhi(iTtPhi), LiTTFlagCount[iTtEta][iTtPhi]);
1415  fill(meMiTtf_, cIndex2iTtEta(iTtEta), cIndex2iTtPhi(iTtPhi), MiTTFlagCount[iTtEta][iTtPhi]);
1416  fill(meHiTtf_, cIndex2iTtEta(iTtEta), cIndex2iTtPhi(iTtPhi), HiTTFlagCount[iTtEta][iTtPhi]);
1417  }
1418  }
1419  if(tpInGeV_){
1420  for(int iE(0);iE<100; iE++){
1421  fill(meTp_, iE, tpEtCount[iE]);
1422  }
1423  } else{
1424  for(int iE(0); iE<40; iE++){
1425  fill(meTp_, iE, tpEtCount[iE]);
1426  }
1427  }
1428 }
int i
Definition: DBlmapReader.cc:9
std::map< uint32_t, uint32_t >::const_iterator EcalTPGGroupsMapItr
Definition: EcalTPGGroups.h:23
CollHandle< EcalTrigPrimDigiCollection > tps_
std::vector< EcalTriggerPrimitiveDigi >::const_iterator const_iterator
static const int nTtPhi
Number of Trigger Towers along Phi.
tuple lut
Definition: lumiPlot.py:244
unsigned towerId(DetId const &)
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
std::map< uint32_t, EcalTPGLut > EcalTPGLutMap
static const int nTtEta
Number of Trigger Towers along Eta.
TProfile * getTProfile(void) const
void fill(MonitorElement *me, float x)
std::map< uint32_t, EcalTPGPhysicsConst::Item > EcalTPGPhysicsConstMap
std::map< uint32_t, EcalTPGPhysicsConst::Item >::const_iterator EcalTPGPhysicsConstMapIterator
std::map< uint32_t, uint32_t > EcalTPGGroupsMap
Definition: EcalTPGGroups.h:22
std::map< uint32_t, EcalTPGLut >::const_iterator EcalTPGLutMapItr
MonitorElement * EcalSelectiveReadoutValidation::book1D ( DQMStore::IBooker ibook,
const std::string &  name,
const std::string &  title,
int  nbins,
double  xmin,
double  xmax 
)
private

Definition at line 1841 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::IBooker::book1D(), Exception, mergeVDriftHistosByStation::name, registerHist(), and mps_fire::result.

Referenced by bookHistograms().

1841  {
1842  if(!registerHist(name, title)) return 0; //this histo is disabled
1844  if(result==0){
1845  throw cms::Exception("Histo")
1846  << "Failed to book histogram " << name;
1847  }
1848  return result;
1849 }
bool registerHist(const std::string &name, const std::string &title)
tuple result
Definition: mps_fire.py:95
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * EcalSelectiveReadoutValidation::book2D ( DQMStore::IBooker ibook,
const std::string &  name,
const std::string &  title,
int  nxbins,
double  xmin,
double  xmax,
int  nybins,
double  ymin,
double  ymax 
)
private

Definition at line 1851 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::IBooker::book2D(), Exception, mergeVDriftHistosByStation::name, registerHist(), and mps_fire::result.

Referenced by bookHistograms().

1851  {
1852  if(!registerHist(name, title)) return 0; //this histo is disabled
1853  MonitorElement* result = ibook.book2D(name, title, nxbins, xmin, xmax,
1854  nybins, ymin, ymax);
1855  if(result==0){
1856  throw cms::Exception("Histo")
1857  << "Failed to book histogram " << name;
1858  }
1859  return result;
1860 }
bool registerHist(const std::string &name, const std::string &title)
tuple result
Definition: mps_fire.py:95
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * EcalSelectiveReadoutValidation::bookFloat ( DQMStore::IBooker ibook,
const std::string &  name 
)
private

Wrappers to the book methods of the DQMStore DQM histogramming interface.

Definition at line 1830 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::IBooker::bookFloat(), Exception, mergeVDriftHistosByStation::name, registerHist(), and mps_fire::result.

Referenced by bookHistograms().

1830  {
1831  if(!registerHist(name, "")) return 0; //this histo is disabled
1832  MonitorElement* result = ibook.bookFloat(name);
1833  if(result==0){
1834  throw cms::Exception("DQM")
1835  << "Failed to book integer DQM monitor element" << name;
1836  }
1837  return result;
1838 }
bool registerHist(const std::string &name, const std::string &title)
tuple result
Definition: mps_fire.py:95
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
void EcalSelectiveReadoutValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 849 of file EcalSelectiveReadoutValidation.cc.

References availableHistList_, book1D(), book2D(), bookFloat(), bookProfile(), bookProfile2D(), ebZsThr_, eeZsThr_, histList_, meChOcc_, meCompleteZSCnt_, meCompleteZSMap_, meCompleteZSRateMap_, meDccHiVol_, meDccLiVol_, meDccVol_, meDccVolFromData_, meDroppedFROCnt_, meDroppedFROMap_, meDroppedFRORateMap_, meEbEMean_, meEbFullRoCnt_, meEbHiZsFir_, meEbLiZsFir_, meEbNoise_, meEbNoZsRecVsSimE_, meEbRecE_, meEbRecEHitXtal_, meEbRecVsSimE_, meEbSimE_, meEbZsErrCnt_, meEbZsErrType1Cnt_, meEeEMean_, meEeFullRoCnt_, meEeHiZsFir_, meEeLiZsFir_, meEeNoise_, meEeNoZsRecVsSimE_, meEeRecE_, meEeRecEHitXtal_, meEeRecVsSimE_, meEeSimE_, meEeZsErrCnt_, meEeZsErrType1Cnt_, meForcedRu_, meForcedTtf_, meFullRoCnt_, meFullRoRu_, meHiTtf_, meIncompleteFROCnt_, meIncompleteFROMap_, meIncompleteFRORateMap_, meL1aRate_, meLiTtf_, meMiTtf_, meSRFlagsConsistency_, meTp_, meTpMap_, meTpVsEtSum_, meTtf_, meTtfVsEtSum_, meTtfVsTp_, meVol_, meVolB_, meVolBHI_, meVolBLI_, meVolE_, meVolEHI_, meVolELI_, meVolHI_, meVolLI_, meZs1Ru_, meZsErrCnt_, meZsErrType1Cnt_, nDccs_, printAvailableHists(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, indexGen::title, and tpInGeV_.

849  {
850 
851  meL1aRate_ = bookFloat(ibooker, "l1aRate_");
852 
853  meDccVol_ = bookProfile(ibooker, "hDccVol", //"EcalDccEventSizeComputed",
854  "ECAL DCC event fragment size;Dcc id; "
855  "<Event size> (kB)", nDccs_, .5, .5+nDccs_);
856 
857  meDccLiVol_ = bookProfile(ibooker, "hDccLiVol",
858  "LI channel payload per DCC;Dcc id; "
859  "<Event size> (kB)", nDccs_, .5, .5+nDccs_);
860 
861  meDccHiVol_ = bookProfile(ibooker, "hDccHiVol",
862  "HI channel payload per DCC;Dcc id; "
863  "<Event size> (kB)", nDccs_, .5, .5+nDccs_);
864 
865  meDccVolFromData_ = bookProfile(ibooker, "hDccVolFromData", //"EcalDccEventSize",
866  "ECAL DCC event fragment size;Dcc id; "
867  "<Event size> (kB)", nDccs_, .5, .5+nDccs_);
868 
869  meVolBLI_ = book1D(ibooker, "hVolBLI",// "EBLowInterestPayload",
870  "ECAL Barrel low interest crystal data payload;"
871  "Event size (kB);Nevts",
872  100, 0., 200.);
873 
874  meVolELI_ = book1D(ibooker, "hVolELI", //"EELowInterestPayload",
875  "Endcap low interest crystal data payload;"
876  "Event size (kB);Nevts",
877  100, 0., 200.);
878 
879  meVolLI_ = book1D(ibooker, "hVolLI", //"EcalLowInterestPayload",
880  "ECAL low interest crystal data payload;"
881  "Event size (kB);Nevts",
882  100, 0., 200.);
883 
884  meVolBHI_ = book1D(ibooker, "hVolBHI", //"EBHighInterestPayload",
885  "Barrel high interest crystal data payload;"
886  "Event size (kB);Nevts",
887  100, 0., 200.);
888 
889  meVolEHI_ = book1D(ibooker, "hVolEHI", //"EEHighInterestPayload",
890  "Endcap high interest crystal data payload;"
891  "Event size (kB);Nevts",
892  100, 0., 200.);
893 
894  meVolHI_ = book1D(ibooker, "hVolHI", //"EcalHighInterestPayload",
895  "ECAL high interest crystal data payload;"
896  "Event size (kB);Nevts",
897  100, 0., 200.);
898 
899  meVolB_ = book1D(ibooker, "hVolB", //"EBEventSize",
900  "Barrel data volume;Event size (kB);Nevts",
901  100, 0., 200.);
902 
903  meVolE_ = book1D(ibooker, "hVolE", //"EEEventSize",
904  "Endcap data volume;Event size (kB);Nevts",
905  100, 0., 200.);
906 
907  meVol_ = book1D(ibooker, "hVol", //"EcalEventSize",
908  "ECAL data volume;Event size (kB);Nevts",
909  100, 0., 200.);
910 
911  meChOcc_ = bookProfile2D(ibooker, "h2ChOcc", //"EcalChannelOccupancy",
912  "ECAL crystal channel occupancy after zero suppression;"
913  "iX -200 / iEta / iX + 100;"
914  "iY / iPhi (starting from -10^{o}!);"
915  "Event count rate",
916  401, -200.5, 200.5,
917  360, .5, 360.5);
918 
919  //TP
920  string tpUnit;
921  if(tpInGeV_) tpUnit = string("GeV"); else tpUnit = string("TP hw unit");
922  string title;
923  title = string("Trigger primitive TT E_{T};E_{T} ")
924  + tpUnit + string(";Event Count");
925  meTp_ = bookProfile(ibooker, "hTp", //"EcalTriggerPrimitiveEt",
926  title.c_str(),
927  (tpInGeV_?100:40), 0., (tpInGeV_?10.:40.));
928 
929  meTtf_ = bookProfile(ibooker, "hTtf", //"EcalTriggerTowerFlag",
930  "Trigger primitive TT flag;Flag number;Event count",
931  8, -.5, 7.5);
932 
933  title = string("Trigger tower flag vs TP;E_{T}(TT) (")
934  + tpUnit + string(");Flag number");
935  meTtfVsTp_ = book2D(ibooker, "h2TtfVsTp",
936  title.c_str(),
937  100, 0., (tpInGeV_?10.:40.),
938  8, -.5, 7.5);
939 
940  meTtfVsEtSum_ = book2D(ibooker, "h2TtfVsEtSum",
941  "Trigger tower flag vs #sumE_{T};"
942  "E_{T}(TT) (GeV);"
943  "TTF",
944  100, 0., 10.,
945  8, -.5, 7.5);
946  title = string("Trigger primitive Et (TP) vs #sumE_{T};"
947  "E_{T} (sum) (GeV);"
948  "E_{T} (TP) (") + tpUnit + string (")");
949 
950  meTpVsEtSum_ = book2D(ibooker, "h2TpVsEtSum",
951  title.c_str(),
952  100, 0., 10.,
953  100, 0., (tpInGeV_?10.:40.));
954 
955  title = string("Trigger primitive E_{T};"
956  "iEta;"
957  "iPhi;"
958  "E_{T} (TP) (") + tpUnit + string (")");
959  meTpMap_ = bookProfile2D(ibooker, "h2Tp",
960  title.c_str(),
961  57, -28.5, 28.5,
962  72, .5, 72.5);
963 
964  //SRF
965  meFullRoRu_ = book2D(ibooker, "h2FRORu", //"EcalFullReadoutSRFlagMap",
966  "Full Read-out readout unit;"
967  "iX - 40 / iEta / iX + 20;"
968  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
969  "Event count",
970  80, -39.5, 40.5,
971  72, .5, 72.5);
972 
973  meFullRoCnt_ = book1D(ibooker, "hFROCnt",
974  "Number of Full-readout-flagged readout units;"
975  "FRO RU count;Event count",
976  300, -.5, 299.5);
977 
978  meEbFullRoCnt_ = book1D(ibooker, "hEbFROCnt",
979  "Number of EB Full-readout-flagged readout units;"
980  "FRO RU count;Event count",
981  200, -.5, 199.5);
982 
983  meEeFullRoCnt_ = book1D(ibooker, "hEeFROCnt",
984  "Number of EE Full-readout-flagged readout units;"
985  "FRO RU count;Event count",
986  200, -.5, 199.5);
987 
988  meZs1Ru_ = book2D(ibooker, "h2Zs1Ru", //"EbZeroSupp1SRFlagMap",
989  "Readout unit with ZS-thr-1 flag;"
990  "iX - 40 / iEta / iX + 20;"
991  "iY0 / iPhi0 (iPhi = 1 at phi = 0 rad);"
992  "Event count",
993  80, -39.5, 40.5,
994  72, .5, 72.5);
995 
996  meForcedRu_ = book2D(ibooker, "h2ForcedRu", //"EcalReadoutUnitForcedBitMap",
997  "ECAL readout unit with forced bit of SR flag on;"
998  "iX - 40 / iEta / iX + 20;"
999  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1000  "Event count",
1001  80, -39.5, 40.5,
1002  72, .5, 72.5);
1003 
1004  meLiTtf_ = bookProfile2D(ibooker, "h2LiTtf", //"EcalLowInterestTriggerTowerFlagMap",
1005  "Low interest trigger tower flags;"
1006  "iEta;"
1007  "iPhi;"
1008  "Event count",
1009  57, -28.5, 28.5,
1010  72, .5, 72.5);
1011 
1012  meMiTtf_ = bookProfile2D(ibooker, "h2MiTtf", //"EcalMidInterestTriggerTowerFlagMap",
1013  "Mid interest trigger tower flags;"
1014  "iEta;"
1015  "iPhi;"
1016  "Event count",
1017  57, -28.5, 28.5,
1018  72, .5, 72.5);
1019 
1020  meHiTtf_ = bookProfile2D(ibooker, "h2HiTtf", //"EcalHighInterestTriggerTowerFlagMap",
1021  "High interest trigger tower flags;"
1022  "iEta;"
1023  "iPhi;"
1024  "Event count",
1025  57, -28.5, 28.5,
1026  72, .5, 72.5);
1027 
1028  meForcedTtf_ = book2D(ibooker, "h2ForcedTtf", //"EcalTtfForcedBitMap",
1029  "Trigger tower flags with forced bit set;"
1030  "iEta;"
1031  "iPhi;"
1032  "Event count",
1033  57, -28.5, 28.5,
1034  72, .5, 72.5);
1035 
1036 
1037  const float ebMinNoise = -1.;
1038  const float ebMaxNoise = 1.;
1039 
1040  const float eeMinNoise = -1.;
1041  const float eeMaxNoise = 1.;
1042 
1043  const float ebMinE = ebMinNoise;
1044  const float ebMaxE = ebMaxNoise;
1045 
1046  const float eeMinE = eeMinNoise;
1047  const float eeMaxE = eeMaxNoise;
1048 
1049  const int evtMax = 500;
1050 
1051  meEbRecE_ = book1D(ibooker, "hEbRecE",
1052  "Crystal reconstructed energy;E (GeV);Event count",
1053  100, ebMinE, ebMaxE);
1054 
1055  meEbEMean_ = bookProfile(ibooker, "hEbEMean",
1056  "EE <E_hit>;event #;<E_hit> (GeV)",
1057  evtMax, .5, evtMax + .5);
1058 
1059  meEbNoise_ = book1D(ibooker, "hEbNoise",
1060  "Crystal noise "
1061  "(rec E of crystal without deposited energy)"
1062  ";Rec E (GeV);Event count",
1063  100, ebMinNoise, ebMaxNoise);
1064 
1065  meEbLiZsFir_ = book1D(ibooker, "zsEbLiFIRemu",
1066  "Emulated ouput of ZS FIR filter for EB "
1067  "low interest crystals;"
1068  "ADC count*4;"
1069  "Event count",
1070  60, -30, 30);
1071 
1072  meEbHiZsFir_ = book1D(ibooker, "zsEbHiFIRemu",
1073  "Emulated ouput of ZS FIR filter for EB "
1074  "high interest crystals;"
1075  "ADC count*4;"
1076  "Event count",
1077  60, -30, 30);
1078 
1079  //TODO: Fill this histogram...
1080 // meEbIncompleteRUZsFir_ = book1D(ibooker, "zsEbIncompleteRUFIRemu",
1081 // "Emulated ouput of ZS FIR filter for EB "
1082 // "incomplete FRO-flagged RU;"
1083 // "ADC count*4;"
1084 // "Event count",
1085 // 60, -30, 30);
1086 
1087  meEbSimE_ = book1D(ibooker, "hEbSimE", "EB hit crystal simulated energy",
1088  100, ebMinE, ebMaxE);
1089 
1090  meEbRecEHitXtal_ = book1D(ibooker, "hEbRecEHitXtal",
1091  "EB rec energy of hit crystals",
1092  100, ebMinE, ebMaxE);
1093 
1094  meEbRecVsSimE_ = book2D(ibooker, "hEbRecVsSimE",
1095  "Crystal simulated vs reconstructed energy;"
1096  "Esim (GeV);Erec GeV);Event count",
1097  100, ebMinE, ebMaxE,
1098  100, ebMinE, ebMaxE);
1099 
1100  meEbNoZsRecVsSimE_ = book2D(ibooker, "hEbNoZsRecVsSimE",
1101  "Crystal no-zs simulated vs reconstructed "
1102  "energy;"
1103  "Esim (GeV);Erec GeV);Event count",
1104  100, ebMinE, ebMaxE,
1105  100, ebMinE, ebMaxE);
1106 
1107  meEeRecE_ = book1D(ibooker, "hEeRecE",
1108  "EE crystal reconstructed energy;E (GeV);"
1109  "Event count",
1110  100, eeMinE, eeMaxE);
1111 
1112  meEeEMean_ = bookProfile(ibooker, "hEeEMean",
1113  "<E_{EE hit}>;event;<E_{hit}> (GeV)",
1114  evtMax, .5, evtMax + .5);
1115 
1116 
1117  meEeNoise_ = book1D(ibooker, "hEeNoise",
1118  "EE crystal noise "
1119  "(rec E of crystal without deposited energy);"
1120  "E (GeV);Event count",
1121  200, eeMinNoise, eeMaxNoise);
1122 
1123  meEeLiZsFir_ = book1D(ibooker, "zsEeLiFIRemu",
1124  "Emulated ouput of ZS FIR filter for EE "
1125  "low interest crystals;"
1126  "ADC count*4;"
1127  "Event count",
1128  60, -30, 30);
1129 
1130  meEeHiZsFir_ = book1D(ibooker, "zsEeHiFIRemu",
1131  "Emulated ouput of ZS FIR filter for EE "
1132  "high interest crystals;"
1133  "ADC count*4;"
1134  "Event count",
1135  60, -30, 30);
1136 
1137  //TODO: Fill this histogram...
1138 // meEeIncompleteRUZsFir_ = book1D(ibooker, "zsEeIncompleteRUFIRemu",
1139 // "Emulated ouput of ZS FIR filter for EE "
1140 // "incomplete FRO-flagged RU;"
1141 // "ADC count*4;"
1142 // "Event count",
1143 // 60, -30, 30);
1144 
1145 
1146  meEeSimE_ = book1D(ibooker, "hEeSimE", "EE hit crystal simulated energy",
1147  100, eeMinE, eeMaxE);
1148 
1149  meEeRecEHitXtal_ = book1D(ibooker, "hEeRecEHitXtal",
1150  "EE rec energy of hit crystals",
1151  100, eeMinE, eeMaxE);
1152 
1153  meEeRecVsSimE_ = book2D(ibooker, "hEeRecVsSimE",
1154  "EE crystal simulated vs reconstructed energy;"
1155  "Esim (GeV);Erec GeV);Event count",
1156  100, eeMinE, eeMaxE,
1157  100, eeMinE, eeMaxE);
1158 
1159  meEeNoZsRecVsSimE_ = book2D(ibooker, "hEeNoZsRecVsSimE",
1160  "EE crystal no-zs simulated vs "
1161  "reconstructed "
1162  "energy;Esim (GeV);Erec GeV);Event count",
1163  100, eeMinE, eeMaxE,
1164  100, eeMinE, eeMaxE);
1165 
1166  meSRFlagsConsistency_ = book2D(ibooker, "hSRAlgoErrorMap",
1167  "TTFlags and SR Flags mismatch;"
1168  "iX - 40 / iEta / iX + 20;"
1169  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1170  "Event count",
1171  80, -39.5, 40.5,
1172  72, .5, 72.5);
1173 
1174  //Readout Units histos (interest/Ncrystals)
1175  meIncompleteFROMap_ = book2D(ibooker, "hIncompleteFROMap",
1176  "Incomplete full-readout-flagged readout units;"
1177  "iX - 40 / iEta / iX + 20;"
1178  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1179  "Event count",
1180  80, -39.5, 40.5,
1181  72, .5, 72.5);
1182 
1183  meIncompleteFROCnt_ = book1D(ibooker, "hIncompleteFROCnt",
1184  "Number of incomplete full-readout-flagged "
1185  "readout units;"
1186  "Number of RUs;Event count;",
1187  200, -.5, 199.5);
1188 
1190  = bookProfile2D(ibooker, "hIncompleteFRORateMap",
1191  "Incomplete full-readout-flagged readout units;"
1192  "iX - 40 / iEta / iX + 20;"
1193  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1194  "Incomplete error rate",
1195  80, -39.5, 40.5,
1196  72, .5, 72.5);
1197 
1198 
1199  meDroppedFROMap_ = book2D(ibooker, "hDroppedFROMap",
1200  "Dropped full-readout-flagged readout units;"
1201  "iX - 40 / iEta / iX + 20;"
1202  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1203  "Event count",
1204  80, -39.5, 40.5,
1205  72, .5, 72.5);
1206 
1207  meDroppedFROCnt_ = book1D(ibooker, "hDroppedFROCnt",
1208  "Number of dropped full-readout-flagged "
1209  "RU count;RU count;Event count",
1210  200, -.5, 199.5);
1211 
1212  meCompleteZSCnt_ = book1D(ibooker, "hCompleteZsCnt",
1213  "Number of zero-suppressed-flagged RU fully "
1214  "readout;"
1215  "RU count;Event count",
1216  200, -.5, 199.5);
1217 
1218  stringstream buf;
1219  buf << "Number of LI EB channels below the " << ebZsThr_/4. << " ADC count ZS threshold;"
1220  "Channel count;Event count",
1221  meEbZsErrCnt_ = book1D(ibooker, "hEbZsErrCnt",
1222  buf.str().c_str(),
1223  200, -.5, 199.5);
1224 
1225  buf.str("");
1226  buf << "Number of LI EE channels below the " << eeZsThr_/4. << " ADC count ZS theshold;"
1227  "Channel count;Event count",
1228  meEeZsErrCnt_ = book1D(ibooker, "hEeZsErrCnt",
1229  buf.str().c_str(),
1230  200, -.5, 199.5);
1231 
1232  meZsErrCnt_ = book1D(ibooker, "hZsErrCnt",
1233  "Number of LI channels below the ZS threshold;"
1234  "Channel count;Event count",
1235  200, -.5, 199.5);
1236 
1237  meEbZsErrType1Cnt_ = book1D(ibooker, "hEbZsErrType1Cnt",
1238  "Number of EB channels below the ZS "
1239  "threshold in a LI but fully readout RU;"
1240  "Channel count;Event count;",
1241  200, -.5, 199.5);
1242 
1243  meEeZsErrType1Cnt_ = book1D(ibooker, "hEeZsErrType1Cnt",
1244  "Number EE channels below the ZS threshold"
1245  " in a LI but fully readout RU;"
1246  "Channel count;Event count",
1247  200, -.5, 199.5);
1248 
1249  meZsErrType1Cnt_ = book1D(ibooker, "hZsErrType1Cnt",
1250  "Number of LI channels below the ZS threshold "
1251  "in a LI but fully readout RU;"
1252  "Channel count;Event count",
1253  200, -.5, 199.5);
1254 
1255 
1257  = bookProfile2D(ibooker, "hDroppedFRORateMap",
1258  "Dropped full-readout-flagged readout units"
1259  "iX - 40 / iEta / iX + 20;"
1260  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1261  "Dropping rate",
1262  80, -39.5, 40.5,
1263  72, .5, 72.5);
1264 
1265  meCompleteZSMap_ = book2D(ibooker, "hCompleteZSMap",
1266  "Complete zero-suppressed-flagged readout units;"
1267  "iX - 40 / iEta / iX + 20;"
1268  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1269  "Event count",
1270  80, -39.5, 40.5,
1271  72, .5, 72.5);
1272 
1274  = bookProfile2D(ibooker, "hCompleteZSRate",
1275  "Complete zero-suppressed-flagged readout units;"
1276  "iX - 40 / iEta / iX + 20;"
1277  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1278  "Completeness rate",
1279  80, -39.5, 40.5,
1280  72, .5, 72.5);
1281 
1282  //print list of available histograms (must be called after
1283  //the bookXX methods):
1285 
1286  //check the histList parameter:
1287  stringstream s;
1288  for(set<string>::iterator it = histList_.begin();
1289  it!=histList_.end();
1290  ++it){
1291  if(*it!=string("all")
1292  && availableHistList_.find(*it)==availableHistList_.end()){
1293  s << (s.str().size()==0?"":", ") << *it;
1294  }
1295  }
1296  if(s.str().size()!=0){
1297  LogWarning("Configuration")
1298  << "Parameter 'histList' contains some unknown histogram(s). "
1299  "Check spelling. Following name were not found: "
1300  << s.str();
1301  }
1302 }
MonitorElement * bookFloat(DQMStore::IBooker &, const std::string &name)
MonitorElement * book2D(DQMStore::IBooker &, const std::string &name, const std::string &title, int nxbins, double xmin, double xmax, int nybins, double ymin, double ymax)
MonitorElement * book1D(DQMStore::IBooker &, const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
MonitorElement * bookProfile(DQMStore::IBooker &, const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
std::map< std::string, std::string > availableHistList_
MonitorElement * bookProfile2D(DQMStore::IBooker &, const std::string &name, const std::string &title, int nbinx, double xmin, double xmax, int nbiny, double ymin, double ymax, const char *option="")
static const unsigned nDccs_
Total number of DCCs.
MonitorElement * EcalSelectiveReadoutValidation::bookProfile ( DQMStore::IBooker ibook,
const std::string &  name,
const std::string &  title,
int  nbins,
double  xmin,
double  xmax 
)
private

Definition at line 1862 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::IBooker::bookProfile(), Exception, mergeVDriftHistosByStation::name, registerHist(), and mps_fire::result.

Referenced by bookHistograms().

1862  {
1863  if(!registerHist(name, title)) return 0; //this histo is disabled
1865  0, 0, 0);
1866  if(result==0){
1867  throw cms::Exception("Histo")
1868  << "Failed to book histogram " << name;
1869  }
1870  return result;
1871 }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool registerHist(const std::string &name, const std::string &title)
tuple result
Definition: mps_fire.py:95
MonitorElement * EcalSelectiveReadoutValidation::bookProfile2D ( DQMStore::IBooker ibook,
const std::string &  name,
const std::string &  title,
int  nbinx,
double  xmin,
double  xmax,
int  nbiny,
double  ymin,
double  ymax,
const char *  option = "" 
)
private

Definition at line 1873 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::IBooker::bookProfile2D(), Exception, mergeVDriftHistosByStation::name, registerHist(), and mps_fire::result.

Referenced by bookHistograms().

1873  {
1874  if(!registerHist(name, title)) return 0; //this histo is disabled
1876  = ibook.bookProfile2D(name,
1877  title,
1878  nbinx, xmin, xmax,
1879  nbiny, ymin, ymax,
1880  0, 0, 0,
1881  option);
1882  if(result==0){
1883  throw cms::Exception("Histo")
1884  << "Failed to book histogram " << name;
1885  }
1886  return result;
1887 }
bool registerHist(const std::string &name, const std::string &title)
tuple result
Definition: mps_fire.py:95
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
template<class T >
void EcalSelectiveReadoutValidation::checkSrApplication ( const edm::Event event,
T srfs 
)
private

Checks application of SR decision by the DCC.

Parameters
eventevent currently analyzed.
srfsSelective readou flags

Definition at line 2197 of file EcalSelectiveReadoutValidation.cc.

References dccCh(), fill(), getCrystalCount(), meCompleteZSMap_, meCompleteZSRateMap_, meDroppedFROMap_, meDroppedFRORateMap_, meIncompleteFROMap_, meIncompleteFRORateMap_, minDccId_, nCompleteZS_, nDroppedFRO_, nIncompleteFRO_, nPerRu_, ruGraphX(), ruGraphY(), srApplicationErrorLog_, EcalSrFlag::SRF_FULL, EcalSrFlag::SRF_ZS1, and EcalSrFlag::SRF_ZS2.

Referenced by analyze().

2198  {
2199  typedef typename T::const_iterator SrFlagCollectionConstIt;
2200  typedef typename T::key_type MyRuDetIdType;
2201 
2202  for(SrFlagCollectionConstIt itSrf = srfs.begin();
2203  itSrf != srfs.end(); ++itSrf){
2204  int flag = itSrf->value() & ~EcalSrFlag::SRF_FORCED_MASK;
2205  pair<int,int> ru = dccCh(itSrf->id());
2206 
2207  if(flag == EcalSrFlag::SRF_FULL){
2208  if(nPerRu_[ru.first-minDccId_][ru.second-1]==getCrystalCount(ru.first, ru.second)){ //no error
2209  fill(meIncompleteFRORateMap_, ruGraphX(itSrf->id()),
2210  ruGraphY(itSrf->id()), 0);
2212  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2213  } else if(nPerRu_[ru.first-minDccId_][ru.second-1]==0) {//tower dropped!
2215  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2217  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2218  fill(meDroppedFROMap_, ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2219  ++nDroppedFRO_;
2220  srApplicationErrorLog_ << event.id() << ": Flag of RU "
2221  << itSrf->id() << " (DCC " << ru.first
2222  << " ch " << ru.second << ") is 'Full readout' "
2223  << "while none of its channel was read out\n";
2224  } else{ //tower partially read out
2226  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2228  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2230  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2231  ++nIncompleteFRO_;
2232  srApplicationErrorLog_ << event.id() << ": Flag of RU"
2233  << itSrf->id() << " (DCC " << ru.first
2234  << " ch " << ru.second << ") is 'Full readout' "
2235  << "while only "
2236  << nPerRu_[ru.first-minDccId_][ru.second-1]
2237  << " / " << getCrystalCount(ru.first, ru.second)
2238  << " channels were read out.\n";
2239  }
2240  }
2241 
2242  if(flag == EcalSrFlag::SRF_ZS1 || flag == EcalSrFlag::SRF_ZS2){
2243  if(nPerRu_[ru.first-minDccId_][ru.second-1]
2244  ==getCrystalCount(ru.first, ru.second)){
2245  //ZS readout unit whose every channel was read
2246 
2247  fill(meCompleteZSMap_, ruGraphX(itSrf->id()), ruGraphY(itSrf->id()));
2249  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2250 
2251  ++nCompleteZS_;
2252  } else{
2254  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2255  }
2256  }
2257  }
2258 }
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
int nIncompleteFRO_
Counter of FRO-flagged RU only partial data.
static const int SRF_ZS2
Definition: EcalSrFlag.h:21
static const int SRF_FULL
Definition: EcalSrFlag.h:24
int nCompleteZS_
Counter of ZS-flagged RU fully read out.
static const int SRF_ZS1
Definition: EcalSrFlag.h:18
int ruGraphX(const EcalScDetId &id) const
int nDroppedFRO_
Counter of FRO-flagged RU dropped from data.
void fill(MonitorElement *me, float x)
int ruGraphY(const EcalScDetId &id) const
std::pair< int, int > dccCh(const DetId &xtalId) const
int EcalSelectiveReadoutValidation::cIndex2iEta ( int  i) const
inlineprivate

converse of iEta2cIndex() method.

Definition at line 251 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh().

251  {
252  return (i<85)?i-85:i-84;
253  }
int i
Definition: DBlmapReader.cc:9
int EcalSelectiveReadoutValidation::cIndex2iPhi ( int  i) const
inlineprivate

converse of iPhi2cIndex() method.

Definition at line 258 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh().

258  {
259  return (i+11) % 360;
260  }
int i
Definition: DBlmapReader.cc:9
int EcalSelectiveReadoutValidation::cIndex2iTtEta ( int  i) const
inlineprivate

converse of iTtEta2cIndex() method.

Definition at line 285 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP().

285  {
286  return (i<27)?i-28:i-27;
287  }
int i
Definition: DBlmapReader.cc:9
int EcalSelectiveReadoutValidation::cIndex2iTtPhi ( int  i) const
inlineprivate

converse of iTtPhi2cIndex() method.

Definition at line 291 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP().

291  {
292  return i + 1;
293  }
int i
Definition: DBlmapReader.cc:9
int EcalSelectiveReadoutValidation::cIndex2iXY ( int  iX0) const
inlineprivate

converse of iXY2cIndex() method.

Definition at line 245 of file EcalSelectiveReadoutValidation.h.

245  {
246  return iX0+1;
247  }
template<class T >
void EcalSelectiveReadoutValidation::compareSrfColl ( const edm::Event event,
T srfFromData,
T computedSrf 
)
private

Compares two SR flag collection, flags read from data and computed flags. Descripencies are recorded in relevant histogram and log file.

Template Parameters
Tcollection type. Must be either an EESrFlagCollection or an EBSrFlagCollection.
Parameters
eventevent currently analyzed. Used in logs.
srfFromDataSR flag collection read from data
compareSrfSR flag collection computed from TTF by SRP emulation

Definition at line 2085 of file EcalSelectiveReadoutValidation.cc.

References dccCh(), fill(), logErrForDccs_, meSRFlagsConsistency_, minDccId_, ruGraphX(), ruGraphY(), and srpAlgoErrorLog_.

Referenced by analyze().

2085  {
2086  typedef typename T::const_iterator SrFlagCollectionConstIt;
2087  typedef typename T::key_type MyRuDetIdType;
2088  SrFlagCollectionConstIt itSrfFromData = srfFromData.begin();
2089  SrFlagCollectionConstIt itComputedSr = computedSrf.begin();
2090 
2091  while(itSrfFromData != srfFromData.end()
2092  || itComputedSr != computedSrf.end()){
2093  MyRuDetIdType inconsistentRu = 0;
2094  bool inconsistent = false;
2095  if(itComputedSr == computedSrf.end() ||
2096  (itSrfFromData != srfFromData.end()
2097  && itSrfFromData->id() < itComputedSr->id())){
2098  //computedSrf is missig a detid found in srfFromData
2099  pair<int, int> ch = dccCh(itSrfFromData->id());
2100  srpAlgoErrorLog_ << event.id() << ": " << itSrfFromData->id()
2101  << ", DCC " << ch.first << " ch " << ch.second
2102  << " found in data (SRF:" << itSrfFromData->flagName()
2103  << ") but not in the set of SRFs computed from the data TTF.\n";
2104  inconsistentRu = itSrfFromData->id();
2105  inconsistent = true;
2106  ++itSrfFromData;
2107  } else if(itSrfFromData==srfFromData.end() ||
2108  (itComputedSr != computedSrf.end()
2109  && itComputedSr->id() < itSrfFromData->id())){
2110  //ebSrFlags is missing a detid found in computedSrf
2111  pair<int, int> ch = dccCh(itComputedSr->id());
2112  if(logErrForDccs_[ch.first-minDccId_]){
2113  srpAlgoErrorLog_ << event.id() << ": " << itComputedSr->id()
2114  << ", DCC " << ch.first << " ch " << ch.second
2115  << " not found in data. Computed SRF: "
2116  << itComputedSr->flagName() << ".\n";
2117  inconsistentRu = itComputedSr->id();
2118  inconsistent = true;
2119  }
2120  ++itComputedSr;
2121  } else{
2122  //*itSrfFromData and *itComputedSr has same detid
2123  if(itComputedSr->value()!=itSrfFromData->value()){
2124  pair<int, int> ch = dccCh(itSrfFromData->id());
2125  srpAlgoErrorLog_ << event.id() << ", "
2126  << itSrfFromData->id()
2127  << ", DCC " << ch.first << " ch " << ch.second
2128  << ", SRF inconsistency: "
2129  << "from data: " << itSrfFromData->flagName()
2130  << ", computed from TTF: "
2131  << itComputedSr->flagName()
2132  << "\n";
2133  inconsistentRu = itComputedSr->id();
2134  inconsistent = true;
2135  }
2136  if(itComputedSr != computedSrf.end()) ++itComputedSr;
2137  if(itSrfFromData != srfFromData.end()) ++itSrfFromData;
2138  }
2139 
2140  if(inconsistent) fill(meSRFlagsConsistency_, ruGraphX(inconsistentRu),
2141  ruGraphY(inconsistentRu));
2142  }
2143 }
int ruGraphX(const EcalScDetId &id) const
void fill(MonitorElement *me, float x)
int ruGraphY(const EcalScDetId &id) const
std::pair< int, int > dccCh(const DetId &xtalId) const
std::ofstream srpAlgoErrorLog_
Output ascii file for unconsistency on SR flags.
void EcalSelectiveReadoutValidation::configFirWeights ( const std::vector< double > &  weightsForZsFIR)
private

Configure DCC ZS FIR weights. Heuristic is used to determine if input weights are normalized weights or integer weights in the hardware representation.

Parameters
weightsForZsFIRweights from configuration file

Definition at line 2014 of file EcalSelectiveReadoutValidation.cc.

References Exception, firstFIRSample_, firWeights_, getFIRWeights(), i, dqm-mbProfile::log, indexGen::s2, and mathSSE::sqrt().

Referenced by EcalSelectiveReadoutValidation().

2014  {
2015  bool notNormalized = false;
2016  bool notInt = false;
2017  for(unsigned i=0; i < weightsForZsFIR.size(); ++i){
2018  if(weightsForZsFIR[i] > 1.) notNormalized = true;
2019  if((int)weightsForZsFIR[i]!=weightsForZsFIR[i]) notInt = true;
2020  }
2021  if(notInt && notNormalized){
2022  throw cms::Exception("InvalidParameter")
2023  << "weigtsForZsFIR paramater values are not valid: they "
2024  << "must either be integer and uses the hardware representation "
2025  << "of the weights or less or equal than 1 and used the normalized "
2026  << "representation.";
2027  }
2028  LogInfo log("DccFir");
2029  if(notNormalized){
2030  firWeights_ = vector<int>(weightsForZsFIR.size());
2031  for(unsigned i = 0; i< weightsForZsFIR.size(); ++i){
2032  firWeights_[i] = (int)weightsForZsFIR[i];
2033  }
2034  } else{
2035  firWeights_ = getFIRWeights(weightsForZsFIR);
2036  }
2037 
2038  log << "Input weights for FIR: ";
2039  for(unsigned i = 0; i < weightsForZsFIR.size(); ++i){
2040  log << weightsForZsFIR[i] << "\t";
2041  }
2042 
2043  double s2 = 0.;
2044  log << "\nActual FIR weights: ";
2045  for(unsigned i = 0; i < firWeights_.size(); ++i){
2046  log << firWeights_[i] << "\t";
2047  s2 += firWeights_[i]*firWeights_[i];
2048  }
2049 
2050  s2 = sqrt(s2);
2051  log << "\nNormalized FIR weights after hw representation rounding: ";
2052  for(unsigned i = 0; i < firWeights_.size(); ++i){
2053  log << firWeights_[i] / (double)(1<<10) << "\t";
2054  }
2055 
2056  log <<"\nFirst FIR sample: " << firstFIRSample_;
2057 }
int i
Definition: DBlmapReader.cc:9
tuple s2
Definition: indexGen.py:106
T sqrt(T t)
Definition: SSEVec.h:18
static std::vector< int > getFIRWeights(const std::vector< double > &normalizedWeights)
pair< int, int > EcalSelectiveReadoutValidation::dccCh ( const DetId xtalId) const
private

Retrieves the logical number of the DCC reading a given crystal channel.

Parameters
xtarIdcrystal channel identifier
Returns
the DCC logical number starting from 1. Retrieves the DCC channel reading out a crystal, the crystals of a barrel trigger tower or the crystals, of an endcap supercrystal.
Parameters
xtarIdcrystal channel, barrel trigger tower or endcap supercrystal identifier
Returns
pair of (DCC ID, DCC channel)

Definition at line 1629 of file EcalSelectiveReadoutValidation.cc.

References cIndex2iEta(), cIndex2iPhi(), EcalElectronicsId::dccId(), TauDecayModes::dec, DetId::det(), DetId::Ecal, EcalBarrel, EcalEndcap, EcalTriggerTower, elecMap_, Exception, EcalElectronicsMapping::getDCCandSC(), EcalElectronicsMapping::getElectronicsId(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), iTtEta2cIndex(), iTtPhi2cIndex(), maxDccId_, minDccId_, nOneEeTtEta, DetId::rawId(), mps_fire::result, DetId::subdetId(), EcalElectronicsId::towerId(), and groupFilesInBlocks::tt.

Referenced by anaDigi(), analyzeEB(), analyzeEE(), checkSrApplication(), compareSrfColl(), and dccId().

1629  {
1630  if(detId.det()!=DetId::Ecal){
1631  throw cms::Exception("InvalidParameter")
1632  << "Wrong type of DetId passed to the "
1633  "EcalSelectiveReadoutValidation::dccCh(const DetId&). "
1634  "An ECAL DetId was expected.\n";
1635  }
1636 
1637  DetId xtalId;
1638  switch(detId.subdetId()){
1639  case EcalTriggerTower: //Trigger tower
1640  {
1641  const EcalTrigTowerDetId tt = detId;
1642  //pick up one crystal of the trigger tower: they are however all readout by
1643  //the same DCC channel in the barrel.
1644  //Arithmetic is easier on the "c" indices:
1645  const int iTtPhi0 = iTtPhi2cIndex(tt.iphi());
1646  const int iTtEta0 = iTtEta2cIndex(tt.ieta());
1647  const int oneXtalPhi0 = iTtPhi0 * 5;
1648  const int oneXtalEta0 = (iTtEta0 - nOneEeTtEta) * 5;
1649 
1650  xtalId = EBDetId(cIndex2iEta(oneXtalEta0),
1651  cIndex2iPhi(oneXtalPhi0));
1652  }
1653  break;
1654  case EcalEndcap:
1655  if(detId.rawId() & 0x8000){ //Supercrystal
1656  return elecMap_->getDCCandSC(EcalScDetId(detId));
1657  } else { //EE crystal
1658  xtalId = detId;
1659  }
1660  break;
1661  case EcalBarrel: //EB crystal
1662  xtalId = detId;
1663  break;
1664  default:
1665  throw cms::Exception("InvalidParameter")
1666  << "Wrong type of DetId passed to the method "
1667  "EcalSelectiveReadoutValidation::dccCh(const DetId&). "
1668  "A valid EcalTriggerTower, EcalBarrel or EcalEndcap DetId was expected. "
1669  "detid = " << xtalId.rawId() << ".\n";
1670  }
1671 
1672  const EcalElectronicsId& EcalElecId = elecMap_->getElectronicsId(xtalId);
1673 
1674  pair<int,int> result;
1675  result.first = EcalElecId.dccId();
1676 
1677  if(result.first < minDccId_ || result.second > maxDccId_){
1678  throw cms::Exception("OutOfRange")
1679  << "Got an invalid DCC ID, DCCID = " << result.first
1680  << " for DetId 0x" << hex << detId.rawId()
1681  << " and 0x" << xtalId.rawId() << dec << "\n";
1682  }
1683 
1684  result.second = EcalElecId.towerId();
1685 
1686  if(result.second < 1 || result.second > 68){
1687  throw cms::Exception("OutOfRange")
1688  << "Got an invalid DCC channel ID, DCC_CH = " << result.second
1689  << " for DetId 0x" << hex << detId.rawId()
1690  << " and 0x" << xtalId.rawId() << dec << "\n";
1691  }
1692 
1693  return result;
1694 }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
int towerId() const
get the tower id
std::pair< int, int > getDCCandSC(EcalScDetId id) const
int ieta() const
get the tower ieta
tuple result
Definition: mps_fire.py:95
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
static const int nOneEeTtEta
Number of Trigger Towers in an endcap along Eta.
Definition: DetId.h:18
int iphi() const
get the tower iphi
const EcalElectronicsMapping * elecMap_
int EcalSelectiveReadoutValidation::dccId ( const EcalScDetId detId) const
private

Retrieves the ID of the DCC reading a readout unit

Parameters
detIddetid of the readout unit

Definition at line 2146 of file EcalSelectiveReadoutValidation.cc.

References elecMap_, and EcalElectronicsMapping::getDCCandSC().

Referenced by selectFedsForLog().

2146  {
2147  return elecMap_->getDCCandSC(detId).first;
2148 }
std::pair< int, int > getDCCandSC(EcalScDetId id) const
const EcalElectronicsMapping * elecMap_
int EcalSelectiveReadoutValidation::dccId ( const EcalTrigTowerDetId detId) const
private

Definition at line 2150 of file EcalSelectiveReadoutValidation.cc.

References dccCh(), Exception, and EcalTrigTowerDetId::ietaAbs().

2150  {
2151  if(detId.ietaAbs()>17){
2152  throw cms::Exception("InvalidArgument")
2153  << "Argument of EcalSelectiveReadoutValidation::dccId(const EcalTrigTowerDetId&) "
2154  << "must be a barrel trigger tower Id\n";
2155  }
2156  return dccCh(detId).first;
2157 }
int ietaAbs() const
get the absolute value of the tower ieta
std::pair< int, int > dccCh(const DetId &xtalId) const
int EcalSelectiveReadoutValidation::dccZsFIR ( const EcalDataFrame frame,
const std::vector< int > &  firWeights,
int  firstFIRSample,
bool *  saturated = 0 
)
staticprivate

Emulates the DCC zero suppression FIR filter. If one of the time sample is not in gain 12, numeric_limits<int>::max() is returned.

Parameters
framedata frame
firWeightsTAP weights
firstFIRSampleindex (starting from 1) of the first time sample to be used in the filter
saturatedif not null, *saturated is set to true if all the time sample are not in gain 12 and set to false otherwise.
Returns
FIR output or numeric_limits<int>::max().

Definition at line 1950 of file EcalSelectiveReadoutValidation.cc.

References EcalMGPASample::adc(), EcalMGPASample::gainId(), LogTrace, bookConverter::max, compare_using_db::sample, EcalDataFrame::size(), and w.

Referenced by analyzeEB(), and analyzeEE().

1953  {
1954  const int nFIRTaps = 6;
1955  //FIR filter weights:
1956  const vector<int>& w = firWeights;
1957 
1958  //accumulator used to compute weighted sum of samples
1959  int acc = 0;
1960  bool gain12saturated = false;
1961  const int gain12 = 0x01;
1962  const int lastFIRSample = firstFIRSample + nFIRTaps - 1;
1963  //LogDebug("DccFir") << "DCC FIR operation: ";
1964  int iWeight = 0;
1965  for(int iSample=firstFIRSample-1;
1966  iSample<lastFIRSample; ++iSample, ++iWeight){
1967  if(iSample>=0 && iSample < frame.size()){
1968  EcalMGPASample sample(frame[iSample]);
1969  if(sample.gainId()!=gain12) gain12saturated = true;
1970  LogTrace("DccFir") << (iSample>=firstFIRSample?"+":"") << sample.adc()
1971  << "*(" << w[iWeight] << ")";
1972  acc+=sample.adc()*w[iWeight];
1973  } else{
1974  edm::LogWarning("DccFir") << __FILE__ << ":" << __LINE__ <<
1975  ": Not enough samples in data frame or 'ecalDccZs1stSample' module "
1976  "parameter is not valid...";
1977  }
1978  }
1979  LogTrace("DccFir") << "\n";
1980  //discards the 8 LSBs
1981  //(shift operator cannot be used on negative numbers because
1982  // the result depends on compilator implementation)
1983  acc = (acc>=0)?(acc >> 8):-(-acc >> 8);
1984  //ZS passed if weighted sum acc above ZS threshold or if
1985  //one sample has a lower gain than gain 12 (that is gain 12 output
1986  //is saturated)
1987 
1988  LogTrace("DccFir") << "acc: " << acc << "\n"
1989  << "saturated: " << (gain12saturated?"yes":"no") << "\n";
1990 
1991  if(saturated){
1992  *saturated = gain12saturated;
1993  }
1994 
1995  return gain12saturated?numeric_limits<int>::max():acc;
1996 }
const double w
Definition: UKUtility.cc:23
int size() const
Definition: EcalDataFrame.h:26
#define LogTrace(id)
void EcalSelectiveReadoutValidation::dqmBeginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 831 of file EcalSelectiveReadoutValidation.cc.

References elecMap_, edm::EventSetup::get(), initAsciiFile(), edm::ESHandle< class >::product(), and triggerTowerMap_.

831  {
832  // endcap mapping
834  es.get<IdealGeometryRecord>().get(hTriggerTowerMap);
835  triggerTowerMap_ = hTriggerTowerMap.product();
836 
837  //electronics map
839  es.get< EcalMappingRcd >().get(ecalmapping);
840  elecMap_ = ecalmapping.product();
841 
842  initAsciiFile();
843 }
T const * product() const
Definition: ESHandle.h:86
const EcalTrigTowerConstituentsMap * triggerTowerMap_
const EcalElectronicsMapping * elecMap_
void EcalSelectiveReadoutValidation::endRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotectedvirtual
void EcalSelectiveReadoutValidation::fill ( MonitorElement me,
float  x 
)
inlineprivate

Wrapper to fill methods of DQM monitor elements.

Definition at line 358 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

Referenced by analyze(), analyzeDataVolume(), analyzeEB(), analyzeEE(), analyzeTP(), checkSrApplication(), and compareSrfColl().

358  {
359  if(me) me->Fill(x);
360  }
void Fill(long long x)
void EcalSelectiveReadoutValidation::fill ( MonitorElement me,
float  x,
float  yw 
)
inlineprivate

Definition at line 361 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

361  {
362  if(me) me->Fill(x, yw);
363  }
void Fill(long long x)
void EcalSelectiveReadoutValidation::fill ( MonitorElement me,
float  x,
float  y,
float  zw 
)
inlineprivate

Definition at line 364 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

364  {
365  if(me) me->Fill(x, y, zw);
366  }
auto zw(V v) -> Vec2< typenamestd::remove_reference< decltype(v[0])>::type >
Definition: ExtVec.h:87
void Fill(long long x)
void EcalSelectiveReadoutValidation::fill ( MonitorElement me,
float  x,
float  y,
float  z,
float  w 
)
inlineprivate

Definition at line 367 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

367  {
368  if(me) me->Fill(x, y, z, w);
369  }
const double w
Definition: UKUtility.cc:23
void Fill(long long x)
double EcalSelectiveReadoutValidation::frame2Energy ( const EcalDataFrame frame) const
private

Selective Readout decisions Validation

Parameters
eventEDM event
esevent setup Energy reconstruction from ADC samples.
framethe ADC sample of an ECA channel

Definition at line 1591 of file EcalSelectiveReadoutValidation.cc.

References assert(), i, min(), gen::n, EcalDataFrame::size(), and weights_.

Referenced by analyzeEB(), and analyzeEE().

1591  {
1592  static std::atomic<bool> firstCall {true};
1593  bool expected = true;
1594  if( firstCall.compare_exchange_strong(expected, false) ) {
1595  stringstream buf;
1596  buf << "Weights:";
1597  for(unsigned i=0; i<weights_.size();++i){
1598  buf << "\t" << weights_[i];
1599  }
1600  edm::LogInfo("EcalSrValid") << buf.str() << "\n";
1601  firstCall = false;
1602  }
1603  double adc2GeV = 0.;
1604 
1605  if(typeid(EBDataFrame)==typeid(frame)){//barrel APD
1606  adc2GeV = .035;
1607  } else if(typeid(EEDataFrame)==typeid(frame)){//endcap VPT
1608  adc2GeV = 0.06;
1609  } else{
1610  assert(false);
1611  }
1612 
1613  double acc = 0;
1614 
1615  const int n = min(frame.size(), (int)weights_.size());
1616 
1617  double gainInv[] = {12., 1., 6., 12.};
1618 
1619  for(int i=0; i < n; ++i){
1620  acc += weights_[i]*frame[i].adc()*gainInv[frame[i].gainId()]*adc2GeV;
1621  }
1622  return acc;
1623 }
int i
Definition: DBlmapReader.cc:9
assert(m_qm.get())
int size() const
Definition: EcalDataFrame.h:26
T min(T a, T b)
Definition: MathUtil.h:58
template<class T >
double EcalSelectiveReadoutValidation::frame2EnergyForTp ( const T frame,
int  offset = 0 
) const
private

Energy reconstruction from ADC samples to be used for trigger primitive estimate.

Parameters
framethe ADC sample of an ECA channel
offsettime offset. To be used to evaluate energy of the event previous (offset=-1) and next (offset=+1) to the triggered one.

Definition at line 1795 of file EcalSelectiveReadoutValidation.cc.

References Exception, i, gen::n, hltrates_dqm_sourceclient-live_cfg::offset, and create_public_pileup_plots::weights.

Referenced by setTtEtSums().

1796  {
1797  //we have to start by 0 in order to handle offset=-1
1798  //(however Fenix FIR has AFAK only 5 taps)
1799  double weights[] = {0., -1/3., -1/3., -1/3., 0., 1.};
1800 
1801  double adc2GeV = 0.;
1802  if(typeid(frame) == typeid(EBDataFrame)){
1803  adc2GeV = 0.035;
1804  } else if(typeid(frame) == typeid(EEDataFrame)){
1805  adc2GeV = 0.060;
1806  } else{ //T is an invalid type!
1807  //TODO: replace message by a cms exception
1808  throw cms::Exception("Severe Error")
1809  << __FILE__ << ":" << __LINE__ << ": "
1810  << "this is a bug. Please report it.\n";
1811  }
1812 
1813  double acc = 0;
1814 
1815  const int n = min<int>(frame.size(), sizeof(weights)/sizeof(weights[0]));
1816 
1817  double gainInv[] = {12., 1., 6., 12};
1818 
1819  for(int i=offset; i < n; ++i){
1820  int iframe = i + offset;
1821  if(iframe>=0 && iframe<frame.size()){
1822  acc += weights[i]*frame[iframe].adc()
1823  *gainInv[frame[iframe].gainId()]*adc2GeV;
1824  }
1825  }
1826  //cout << "\n";
1827  return acc;
1828 }
int i
Definition: DBlmapReader.cc:9
double EcalSelectiveReadoutValidation::getBytesPerCrystal ( ) const
inlineprivate

Gets the number of bytes per crystal channel of the event part depending on the number of read crystal channels.

Returns
the number of bytes.

Definition at line 145 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), getDccSrDependentPayload(), getEbEventSize(), and getEeEventSize().

145  {
146  return 3*8;
147  }
int EcalSelectiveReadoutValidation::getCrystalCount ( int  iDcc,
int  iDccCh 
)
private

Retrieves number of crystal channel read out by a DCC channel

Parameters
iDccDCC ID starting from 1
iDccChDCC channel starting from 1
Returns
crystal count

Definition at line 2260 of file EcalSelectiveReadoutValidation.cc.

References maxDccId_.

Referenced by analyzeDataVolume(), and checkSrApplication().

2260  {
2261  if(iDcc < minDccId_ || iDcc > maxDccId_){ //invalid DCC
2262  return 0;
2263  } else if (10 <= iDcc && iDcc <= 45) {//EB
2264  return 25;
2265  } else { //EE
2266  int iDccPhi;
2267  if(iDcc < 10) iDccPhi = iDcc;
2268  else iDccPhi = iDcc - 45;
2269  switch(iDccPhi*100+iDccCh){
2270  case 110:
2271  case 232:
2272  case 312:
2273  case 412:
2274  case 532:
2275  case 610:
2276  case 830:
2277  case 806:
2278  //inner partials at 12, 3, and 9 o'clock
2279  return 20;
2280  case 134:
2281  case 634:
2282  case 827:
2283  case 803:
2284  return 10;
2285  case 330:
2286  case 430:
2287  return 20;
2288  case 203:
2289  case 503:
2290  case 721:
2291  case 921:
2292  return 21;
2293  default:
2294  return 25;
2295  }
2296  }
2297 }
double EcalSelectiveReadoutValidation::getDccEventSize ( int  iDcc0,
double  nReadXtals 
) const
inlineprivate

Gets the size of an DCC event fragment.

Parameters
iDcc0the DCC logical number starting from 0.
nReadXtalsnumber of read crystal channels.
Returns
the DCC event fragment size in bytes.

Definition at line 154 of file EcalSelectiveReadoutValidation.h.

References EB, EE, getDccOverhead(), getDccSrDependentPayload(), and getRuCount().

Referenced by analyzeDataVolume().

154  {
155  subdet_t subdet;
156  if(iDcc0<9 || iDcc0>=45){
157  subdet = EE;
158  } else{
159  subdet = EB;
160  }
161  // return getDccOverhead(subdet)+nReadXtals*getBytesPerCrystal()
162  // + getRuCount(iDcc0)*8;
163  return getDccOverhead(subdet)
164  + getDccSrDependentPayload(iDcc0, getRuCount(iDcc0), nReadXtals);
165  }
double getDccSrDependentPayload(int iDcc0, double nReadRus, double nReadXtals) const
double getDccOverhead(subdet_t subdet) const
subdet_t
distinguishes barral and endcap of ECAL.
double EcalSelectiveReadoutValidation::getDccOverhead ( subdet_t  subdet) const
inlineprivate

Gets the size in bytes fixed-size part of a DCC event fragment.

Returns
the fixed size in bytes.

Definition at line 136 of file EcalSelectiveReadoutValidation.h.

References EB.

Referenced by getDccEventSize(), getEbEventSize(), and getEeEventSize().

136  {
137  // return (subdet==EB?34:25)*8;
138  return (subdet==EB?34:52)*8;
139  }
double EcalSelectiveReadoutValidation::getDccSrDependentPayload ( int  iDcc0,
double  nReadRus,
double  nReadXtals 
) const
inlineprivate

Gets DCC event fragment payload depending on the channel selection made by the selective readout.

Parameters
iDcc0the DCC logical number starting from 0.
nReadRusnumber of read-out RUs
nReadXtalsnumber of read-out crystal channels.
Returns
the DCC event fragment payload in bytes.

Definition at line 174 of file EcalSelectiveReadoutValidation.h.

References getBytesPerCrystal().

Referenced by analyzeDataVolume(), and getDccEventSize().

175  {
176  return nReadXtals*getBytesPerCrystal() + nReadRus*8;
177  }
double EcalSelectiveReadoutValidation::getEbEventSize ( double  nReadXtals) const
private

Computes the size of an ECAL barrel event fragment.

Parameters
nReadXtalsnumber of read crystal channels
Returns
the event fragment size in bytes

Definition at line 1924 of file EcalSelectiveReadoutValidation.cc.

References EB, getBytesPerCrystal(), getDccOverhead(), getRuCount(), nEbDccs, and nEeDccs.

Referenced by analyzeDataVolume().

1924  {
1925  double ruHeaderPayload = 0.;
1926  const int firstEbDcc0 = nEeDccs/2;
1927  for(int iDcc0 = firstEbDcc0; iDcc0 < firstEbDcc0 + nEbDccs; ++iDcc0){
1928  ruHeaderPayload += getRuCount(iDcc0)*8.;
1929  }
1930 
1931  return getDccOverhead(EB)*nEbDccs + nReadXtals*getBytesPerCrystal()
1932  + ruHeaderPayload;
1933 }
double getDccOverhead(subdet_t subdet) const
static const int nEeDccs
number of DCCs for EE
static const int nEbDccs
number of DCCs for EB
double EcalSelectiveReadoutValidation::getEeEventSize ( double  nReadXtals) const
private

Computes the size of an ECAL endcap event fragment.

Parameters
nReadXtalsnumber of read crystal channels
Returns
the event fragment size in bytes

Definition at line 1935 of file EcalSelectiveReadoutValidation.cc.

References EE, getBytesPerCrystal(), getDccOverhead(), getRuCount(), nDccs_, nEbDccs, and nEeDccs.

Referenced by analyzeDataVolume().

1935  {
1936  double ruHeaderPayload = 0.;
1937  const unsigned firstEbDcc0 = nEeDccs/2;
1938  for(unsigned iDcc0 = 0; iDcc0 < nDccs_; ++iDcc0){
1939  //skip barrel:
1940  if(iDcc0== firstEbDcc0) iDcc0 += nEbDccs;
1941  ruHeaderPayload += getRuCount(iDcc0)*8.;
1942  }
1943  return getDccOverhead(EE)*nEeDccs + nReadXtals*getBytesPerCrystal()
1944  + ruHeaderPayload;
1945 }
double getDccOverhead(subdet_t subdet) const
static const int nEeDccs
number of DCCs for EE
static const int nEbDccs
number of DCCs for EB
static const unsigned nDccs_
Total number of DCCs.
std::vector< int > EcalSelectiveReadoutValidation::getFIRWeights ( const std::vector< double > &  normalizedWeights)
staticprivate

Computes the ZS FIR filter weights from the normalized weights.

Parameters
normalizedWeightsthe normalized weights
Returns
the computed ZS filter weights.

Definition at line 1999 of file EcalSelectiveReadoutValidation.cc.

References funct::abs(), i, and min().

Referenced by configFirWeights().

2000  {
2001  const int nFIRTaps = 6;
2002  vector<int> firWeights(nFIRTaps, 0); //default weight: 0;
2003  const static int maxWeight = 0xEFF; //weights coded on 11+1 signed bits
2004  for(unsigned i=0; i < min((size_t)nFIRTaps,normalizedWeights.size()); ++i){
2005  firWeights[i] = lround(normalizedWeights[i] * (1<<10));
2006  if(abs(firWeights[i])>maxWeight){//overflow
2007  firWeights[i] = firWeights[i]<0?-maxWeight:maxWeight;
2008  }
2009  }
2010  return firWeights;
2011 }
int i
Definition: DBlmapReader.cc:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
double EcalSelectiveReadoutValidation::getL1aRate ( ) const
private

Gets L1A rate estimate.

See Also
updateL1aRate(const edm::Event&)
Returns
L1A rate estimate

Definition at line 181 of file EcalSelectiveReadoutValidation.cc.

References alignCSCRings::e, l1aOfTmax, l1aOfTmin, LogDebug, tmax, and tmin.

Referenced by endRun().

181  {
182  LogDebug("EcalSrValid") << __FILE__ << ":" << __LINE__ << ": "
183  << "Tmax = " << tmax << " x 25ns; Tmin = " << tmin
184  << " x 25ns; L1A(Tmax) = " << l1aOfTmax << "; L1A(Tmin) = "
185  << l1aOfTmin << "\n";
186  return (double)(l1aOfTmax - l1aOfTmin) / ((tmax-tmin) * 25e-9);
187 }
#define LogDebug(id)
int EcalSelectiveReadoutValidation::getRuCount ( int  iDcc0) const
private

Gets the number of readout unit read by a DCC. A readout unit correspond to an active DCC input channel.

Parameters
iDcc0DCC logical number starting from 0.

Definition at line 1625 of file EcalSelectiveReadoutValidation.cc.

References nRuPerDcc_.

Referenced by getDccEventSize(), getEbEventSize(), and getEeEventSize().

1625  {
1626  return nRuPerDcc_[iDcc0];
1627 }
int EcalSelectiveReadoutValidation::iEta2cIndex ( int  iEta) const
inlineprivate

Converts a std CMSSW crystal eta index to a c-array index (starting from zero and without hole).

Definition at line 222 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and analyzeEB().

222  {
223  return (iEta<0)?iEta+85:iEta+84;
224  }
void EcalSelectiveReadoutValidation::initAsciiFile ( )
private

Definition at line 2059 of file EcalSelectiveReadoutValidation.cc.

References Exception, logSrApplicationErrors_, logSrpAlgoErrors_, GenerateHcalLaserBadRunList::out, srApplicationErrorLog_, srApplicationErrorLogFileName_, srpAlgoErrorLog_, srpAlgoErrorLogFileName_, and estimatePileup_makeJSON::trunc.

Referenced by dqmBeginRun().

2059  {
2060  if(logSrpAlgoErrors_){
2062  if(!srpAlgoErrorLog_.good()){
2063  throw cms::Exception("Output")
2064  << "Failed to open the log file '"
2066  << "' for SRP algorithm result check.\n";
2067  }
2068  }
2069 
2072  if(!srApplicationErrorLog_.good()){
2073  throw cms::Exception("Output")
2074  << "Failed to open the log file '"
2076  << "' for Selective Readout decision application check.\n";
2077  }
2078  }
2079 }
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
std::ofstream srpAlgoErrorLog_
Output ascii file for unconsistency on SR flags.
int EcalSelectiveReadoutValidation::iPhi2cIndex ( int  iPhi) const
inlineprivate

Converts a std CMSSW crystal phi index to a c-array index (starting from zero and without hole).

Definition at line 229 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and analyzeEB().

229  {
230  // return iPhi-1;
231  int iPhi0 = iPhi - 11;
232  if(iPhi0<0) iPhi0 += 360;
233  return iPhi0;
234  }
int EcalSelectiveReadoutValidation::iTtEta2cIndex ( int  iEta) const
inlineprivate

Transforms CMSSW eta ECAL TT indices to indices starting at 0 to use for c-array or vector.

Parameters
iEtaCMSSW eta index (numbering -28...-1,28...56)
Returns
index in numbering from 0 to 55

Definition at line 267 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), dccCh(), and setTtEtSums().

267  {
268  return (iEta<0)?iEta+28:iEta+27;
269  }
int EcalSelectiveReadoutValidation::iTtPhi2cIndex ( int  iPhi) const
inlineprivate

Transforms CMSSW phi ECAL crystal indices to indices starting at 0 to use for c-array or vector.

Parameters
iPhiCMSSW phi index (numbering 1...72)
Returns
index in numbering 0...71

Definition at line 276 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), dccCh(), and setTtEtSums().

276  {
277  return iPhi-1;
278  //int iPhi0 = iPhi - 3;
279  //if(iPhi0<0) iPhi0 += 72;
280  //return iPhi0;
281  }
int EcalSelectiveReadoutValidation::iXY2cIndex ( int  iX) const
inlineprivate

Converts a std CMSSW crystal x or y index to a c-array index (starting from zero and without hole).

Definition at line 239 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and analyzeEE().

239  {
240  return iX-1;
241  }
void EcalSelectiveReadoutValidation::printAvailableHists ( )
private

Prints the list of available histograms (registered by the registerHist method), including disabled one.

Definition at line 1912 of file EcalSelectiveReadoutValidation.cc.

References availableHistList_, and dqm-mbProfile::log.

Referenced by bookHistograms().

1912  {
1913  LogInfo log("HistoList");
1914  log << "Avalailable histograms (DQM monitor elements): \n";
1915  for(map<string, string>::iterator it = availableHistList_.begin();
1916  it != availableHistList_.end();
1917  ++it){
1918  log << it->first << ": " << it->second << "\n";
1919  }
1920  log << "\nTo include an histogram add its name in the vstring parameter "
1921  "'histograms' of the EcalSelectiveReadoutValidation module\n";
1922 }
std::map< std::string, std::string > availableHistList_
void EcalSelectiveReadoutValidation::readAllCollections ( const edm::Event e)
private

Reads the data collections from the event. Called at start of each event analysis.

Parameters
eventthe EDM event.

Definition at line 1895 of file EcalSelectiveReadoutValidation.cc.

References ebComputedSrFlags_, ebDigis_, ebNoZsDigis_, ebRecHits_, ebSimHits_, ebSrFlags_, eeComputedSrFlags_, eeDigis_, eeNoZsDigis_, eeRecHits_, eeSimHits_, eeSrFlags_, fedRaw_, CollHandle< T >::read(), and tps_.

Referenced by analyze().

1895  {
1896  ebRecHits_.read(event);
1897  eeRecHits_.read(event);
1898  ebDigis_.read(event);
1899  eeDigis_.read(event);
1902  ebSrFlags_.read(event);
1903  eeSrFlags_.read(event);
1904  ebComputedSrFlags_.read(event);
1905  eeComputedSrFlags_.read(event);
1908  tps_.read(event);
1909  fedRaw_.read(event);
1910 }
CollHandle< EBDigiCollection > ebNoZsDigis_
CollHandle< EcalTrigPrimDigiCollection > tps_
CollHandle< FEDRawDataCollection > fedRaw_
CollHandle< EESrFlagCollection > eeComputedSrFlags_
CollHandle< EEDigiCollection > eeDigis_
CollHandle< RecHitCollection > eeRecHits_
CollHandle< EBSrFlagCollection > ebSrFlags_
CollHandle< std::vector< PCaloHit > > eeSimHits_
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
void read(const edm::Event &event)
Definition: CollHandle.h:62
CollHandle< EESrFlagCollection > eeSrFlags_
CollHandle< std::vector< PCaloHit > > ebSimHits_
CollHandle< EEDigiCollection > eeNoZsDigis_
CollHandle< EBDigiCollection > ebDigis_
CollHandle< RecHitCollection > ebRecHits_
CollHandle< EBSrFlagCollection > ebComputedSrFlags_
EcalTrigTowerDetId EcalSelectiveReadoutValidation::readOutUnitOf ( const EBDetId xtalId) const
private

Retrives the readout unit, a trigger tower in the barrel case, and a supercrystal in the endcap case, a given crystal belongs to.

Parameters
xtalIdidentifier of the crystal
Returns
identifer of the supercrystal or of the trigger tower.

Definition at line 1697 of file EcalSelectiveReadoutValidation.cc.

References EcalTrigTowerConstituentsMap::towerOf(), and triggerTowerMap_.

Referenced by anaDigi(), analyzeEB(), and analyzeEE().

1697  {
1698  return triggerTowerMap_->towerOf(xtalId);
1699 }
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
const EcalTrigTowerConstituentsMap * triggerTowerMap_
EcalScDetId EcalSelectiveReadoutValidation::readOutUnitOf ( const EEDetId xtalId) const
private

Definition at line 1702 of file EcalSelectiveReadoutValidation.cc.

References EcalElectronicsId::dccId(), elecMap_, EcalElectronicsMapping::getEcalScDetId(), EcalElectronicsMapping::getElectronicsId(), and EcalElectronicsId::towerId().

1702  {
1703  const EcalElectronicsId& EcalElecId = elecMap_->getElectronicsId(xtalId);
1704  int iDCC= EcalElecId.dccId();
1705  int iDccChan = EcalElecId.towerId();
1706  const bool ignoreSingle = true;
1707  const vector<EcalScDetId> id = elecMap_->getEcalScDetId(iDCC, iDccChan, ignoreSingle);
1708  return id.size()>0?id[0]:EcalScDetId();
1709 }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
int towerId() const
get the tower id
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
std::vector< EcalScDetId > getEcalScDetId(int DCCid, int DCC_Channel, bool ignoreSingleCrystal=true) const
const EcalElectronicsMapping * elecMap_
bool EcalSelectiveReadoutValidation::registerHist ( const std::string &  name,
const std::string &  title 
)
private

Register a histogram in the available histogram list and check if the histogram is enabled. Called by the histogram booking methods.

Returns
true if the histogram is enable, false otherwise

Definition at line 1889 of file EcalSelectiveReadoutValidation.cc.

References allHists_, availableHistList_, and histList_.

Referenced by book1D(), book2D(), bookFloat(), bookProfile(), and bookProfile2D().

1890  {
1891  availableHistList_.insert(pair<string, string>(name, title));
1892  return allHists_ || histList_.find(name)!=histList_.end();
1893 }
std::map< std::string, std::string > availableHistList_
int EcalSelectiveReadoutValidation::ruGraphX ( const EcalScDetId id) const
inlineprivate

Functions to compute x and y coordinates of RU maps grouping endcap and barrel.

Definition at line 883 of file EcalSelectiveReadoutValidation.h.

Referenced by checkSrApplication(), and compareSrfColl().

883  {
884  return id.ix() + (id.zside()>0?20:-40);
885  }
int EcalSelectiveReadoutValidation::ruGraphX ( const EcalTrigTowerDetId id) const
inlineprivate

Definition at line 891 of file EcalSelectiveReadoutValidation.h.

891  {
892  return id.ieta();
893  }
int EcalSelectiveReadoutValidation::ruGraphY ( const EcalScDetId id) const
inlineprivate

Definition at line 887 of file EcalSelectiveReadoutValidation.h.

Referenced by checkSrApplication(), and compareSrfColl().

887  {
888  return id.iy();
889  }
int EcalSelectiveReadoutValidation::ruGraphY ( const EcalTrigTowerDetId id) const
inlineprivate

Definition at line 895 of file EcalSelectiveReadoutValidation.h.

895  {
896  return id.iphi();
897  }
void EcalSelectiveReadoutValidation::selectFedsForLog ( )
private

Look in events whose DCC has SR flags and enable error logging for them. To be called with the processed first event. List of monitored DCCs is reported in the log file.

Definition at line 2161 of file EcalSelectiveReadoutValidation.cc.

References dccId(), ebSrFlags_, eeSrFlags_, plotBeamSpotDB::first, logErrForDccs_, minDccId_, nDccs_, srApplicationErrorLog_, and srpAlgoErrorLog_.

Referenced by analyze().

2161  {
2162  logErrForDccs_ = vector<bool>(nDccs_, false);
2163 
2165  it != ebSrFlags_->end();
2166  ++it){
2167  int iDcc = dccId(it->id()) - minDccId_;
2168 
2169  logErrForDccs_.at(iDcc) = true;
2170  }
2171 
2173  it != eeSrFlags_->end();
2174  ++it){
2175  int iDcc = dccId(it->id()) - minDccId_;
2176 
2177  logErrForDccs_.at(iDcc) = true;
2178  }
2179 
2180  stringstream buf;
2181  buf << "List of DCCs found in the first processed event: ";
2182  bool first = true;
2183  for(unsigned iDcc = 0; iDcc < nDccs_; ++iDcc){
2184  if(logErrForDccs_[iDcc]){
2185  buf << (first?"":", ") << (iDcc + minDccId_);
2186  first = false;
2187  }
2188  }
2189  buf << "\nOnly DCCs from this list will be considered for error logging\n";
2190  srpAlgoErrorLog_ << buf.str();
2191  srApplicationErrorLog_<< buf.str();
2192  LogInfo("EcalSrValid") << buf.str();
2193 }
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
std::vector< EBSrFlag >::const_iterator const_iterator
CollHandle< EBSrFlagCollection > ebSrFlags_
CollHandle< EESrFlagCollection > eeSrFlags_
int dccId(const EcalScDetId &detId) const
std::ofstream srpAlgoErrorLog_
Output ascii file for unconsistency on SR flags.
static const unsigned nDccs_
Total number of DCCs.
void EcalSelectiveReadoutValidation::setTtEtSums ( const edm::EventSetup es,
const EBDigiCollection ebDigis,
const EEDigiCollection eeDigis 
)
private

Computes trigger primitive estimates. A sum of crystal deposited transverse energy is performed.

Parameters
esevent setup
ebDigisthe ECAL barrel unsuppressed digi to use for the computation
ebDigisthe ECAL endcap unsuppressed digi to use for the computation

Definition at line 1712 of file EcalSelectiveReadoutValidation.cc.

References edm::DataFrameContainer::begin(), alignCSCRings::e, ebDigis_, DetId::Ecal, EcalBarrel, EcalEndcap, edm::DataFrameContainer::end(), frame2EnergyForTp(), edm::EventSetup::get(), CaloSubdetectorGeometry::getGeometry(), EEDataFrame::id(), EBDataFrame::id(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), iTtEta2cIndex(), iTtPhi2cIndex(), nTtEta, nTtPhi, funct::sin(), theta(), EcalTrigTowerConstituentsMap::towerOf(), triggerTowerMap_, ttEtSums, and ecaldqm::ttId().

Referenced by analyze().

1714  {
1715  //ecal geometry:
1716  static const CaloSubdetectorGeometry* eeGeometry = 0;
1717  static const CaloSubdetectorGeometry* ebGeometry = 0;
1718  if(eeGeometry==0 || ebGeometry==0){
1719  edm::ESHandle<CaloGeometry> geoHandle;
1720  es.get<CaloGeometryRecord>().get(geoHandle);
1721  eeGeometry
1722  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
1723  ebGeometry
1724  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
1725  }
1726 
1727  //init etSum array:
1728  for(int iEta0 = 0; iEta0 < nTtEta; ++iEta0){
1729  for(int iPhi0 = 0; iPhi0 < nTtPhi; ++iPhi0){
1730  ttEtSums[iEta0][iPhi0] = 0.;
1731  }
1732  }
1733 
1735  it != ebDigis_->end(); ++it){
1736  const EBDataFrame& frame = *it;
1737  const EcalTrigTowerDetId& ttId = triggerTowerMap_->towerOf(frame.id());
1738 
1739  const int iTtEta0 = iTtEta2cIndex(ttId.ieta());
1740  const int iTtPhi0 = iTtPhi2cIndex(ttId.iphi());
1741  double theta = ebGeometry->getGeometry(frame.id())->getPosition().theta();
1742  double e = frame2EnergyForTp(frame);
1743  if((frame2EnergyForTp(frame,-1) < e) && (frame2EnergyForTp(frame, 1) < e)){
1744  ttEtSums[iTtEta0][iTtPhi0] += e*sin(theta);
1745  }
1746  }
1747 
1748  for(EEDigiCollection::const_iterator it = eeDigis.begin();
1749  it != eeDigis.end(); ++it){
1750  const EEDataFrame& frame = *it;
1751  const EcalTrigTowerDetId& ttId = triggerTowerMap_->towerOf(frame.id());
1752  const int iTtEta0 = iTtEta2cIndex(ttId.ieta());
1753  const int iTtPhi0 = iTtPhi2cIndex(ttId.iphi());
1754 
1755  double theta = eeGeometry->getGeometry(frame.id())->getPosition().theta();
1756  double e = frame2EnergyForTp(frame);
1757  if((frame2EnergyForTp(frame,-1) < e) && (frame2EnergyForTp(frame, 1) < e)){
1758  ttEtSums[iTtEta0][iTtPhi0] += e*sin(theta);
1759  }
1760  }
1761 
1762  //dealing with pseudo-TT in two inner EE eta-ring:
1763  int innerTTEtas[] = {0, 1, 54, 55};
1764  for(unsigned iRing = 0; iRing < sizeof(innerTTEtas)/sizeof(innerTTEtas[0]);
1765  ++iRing){
1766  int iTtEta0 = innerTTEtas[iRing];
1767  //this detector eta-section is divided in only 36 phi bins
1768  //For this eta regions,
1769  //current tower eta numbering scheme is inconsistent. For geometry
1770  //version 133:
1771  //- TT are numbered from 0 to 72 for 36 bins
1772  //- some TT have an even index, some an odd index
1773  //For geometry version 125, there are 72 phi bins.
1774  //The code below should handle both geometry definition.
1775  //If there are 72 input trigger primitives for each inner eta-ring,
1776  //then the average of the trigger primitive of the two pseudo-TT of
1777  //a pair (nEta, nEta+1) is taken as Et of both pseudo TTs.
1778  //If there are only 36 input TTs for each inner eta ring, then half
1779  //of the present primitive of a pseudo TT pair is used as Et of both
1780  //pseudo TTs.
1781 
1782  for(unsigned iTtPhi0 = 0; iTtPhi0 < nTtPhi-1; iTtPhi0 += 2){
1783  double et = .5*(ttEtSums[iTtEta0][iTtPhi0]
1784  +ttEtSums[iTtEta0][iTtPhi0+1]);
1785  //divides the TT into 2 phi bins in order to match with 72 phi-bins SRP
1786  //scheme or average the Et on the two pseudo TTs if the TT is already
1787  //divided into two trigger primitives.
1788  ttEtSums[iTtEta0][iTtPhi0] = et;
1789  ttEtSums[iTtEta0][iTtPhi0+1] = et;
1790  }
1791  }
1792 }
key_type id() const
Definition: EBDataFrame.h:31
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
const_iterator begin() const
unsigned ttId(DetId const &)
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
int ieta() const
get the tower ieta
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
double frame2EnergyForTp(const T &frame, int offset=0) const
static const int nTtPhi
Number of Trigger Towers along Phi.
key_type id() const
Definition: EEDataFrame.h:28
int iphi() const
get the tower iphi
const T & get() const
Definition: EventSetup.h:56
const_iterator end() const
static const int nTtEta
Number of Trigger Towers along Eta.
CollHandle< EBDigiCollection > ebDigis_
const EcalTrigTowerConstituentsMap * triggerTowerMap_
void EcalSelectiveReadoutValidation::updateL1aRate ( const edm::Event event)
private

Updates estimate of L1A rate

Parameters
eventEDM event

Definition at line 164 of file EcalSelectiveReadoutValidation.cc.

References l1aOfTmax, l1aOfTmin, lumiQTWidget::t, tmax, and tmin.

Referenced by analyze().

164  {
165  const int32_t bx = event.bunchCrossing();
166  if(bx<1 || bx > 3564) return;
167 
168  int64_t t = event.bunchCrossing() + (event.orbitNumber()-1)*3564;
169 
170  if(t<tmin){
171  tmin = t;
172  l1aOfTmin = event.id().event();
173  }
174 
175  if(t>tmax){
176  tmax = t;
177  l1aOfTmax = event.id().event();
178  }
179 }
int EcalSelectiveReadoutValidation::xtalGraphX ( const EEDetId id) const
inlineprivate

Definition at line 899 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and analyzeEE().

899  {
900  return id.ix() + (id.zside()>0?100:-200);
901  }
int EcalSelectiveReadoutValidation::xtalGraphX ( const EBDetId id) const
inlineprivate

Definition at line 907 of file EcalSelectiveReadoutValidation.h.

907  {
908  return id.ieta();
909  }
int EcalSelectiveReadoutValidation::xtalGraphY ( const EEDetId id) const
inlineprivate

Definition at line 903 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and analyzeEE().

903  {
904  return id.iy();
905  }
int EcalSelectiveReadoutValidation::xtalGraphY ( const EBDetId id) const
inlineprivate

Definition at line 911 of file EcalSelectiveReadoutValidation.h.

911  {
912  return id.iphi();
913  }

Member Data Documentation

bool EcalSelectiveReadoutValidation::allHists_
private

When true, every histogram is enabled.

Definition at line 811 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and registerHist().

std::map<std::string, std::string> EcalSelectiveReadoutValidation::availableHistList_
private

List of available histograms. Filled by the booking methods. key: name, value: title.

Definition at line 820 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), printAvailableHists(), and registerHist().

bool EcalSelectiveReadoutValidation::collNotFoundWarn_
private

Switch for collection-not-found warning.

Definition at line 488 of file EcalSelectiveReadoutValidation.h.

CollHandle<EBSrFlagCollection> EcalSelectiveReadoutValidation::ebComputedSrFlags_
private
CollHandle<EBDigiCollection> EcalSelectiveReadoutValidation::ebDigis_
private

The event product collections.

Definition at line 510 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), analyzeEB(), EcalSelectiveReadoutValidation(), readAllCollections(), and setTtEtSums().

energiesEb_t EcalSelectiveReadoutValidation::ebEnergies[nEbEta][nEbPhi]
private

Energy deposited in ECAL barrel crystals. Eta index starts from 0 at eta minimum and phi index starts at phi=0+ in CMS std coordinate system.

Definition at line 792 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB().

CollHandle<EBDigiCollection> EcalSelectiveReadoutValidation::ebNoZsDigis_
private
CollHandle<RecHitCollection> EcalSelectiveReadoutValidation::ebRecHits_
private
bool EcalSelectiveReadoutValidation::ebRuActive_[nEbEta/ebTtEdge][nEbPhi/ebTtEdge]
private

For book keeping of RU actually read out (not fully zero suppressed)

Definition at line 769 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and anaDigiInit().

CollHandle<std::vector<PCaloHit> > EcalSelectiveReadoutValidation::ebSimHits_
private
CollHandle<EBSrFlagCollection> EcalSelectiveReadoutValidation::ebSrFlags_
private
const int EcalSelectiveReadoutValidation::ebTtEdge = 5
staticprivate

Number of crystals along an EB TT.

Definition at line 459 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi().

int EcalSelectiveReadoutValidation::ebZsThr_
private

ZS threshold in 1/4th ADC count for EB

Definition at line 690 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), bookHistograms(), and EcalSelectiveReadoutValidation().

CollHandle<EESrFlagCollection> EcalSelectiveReadoutValidation::eeComputedSrFlags_
private
CollHandle<EEDigiCollection> EcalSelectiveReadoutValidation::eeDigis_
private
energiesEe_t EcalSelectiveReadoutValidation::eeEnergies[nEndcaps][nEeX][nEeY]
private

Energy deposited in ECAL endcap crystals. Endcap index is 0 for EE- and 1 for EE+. X and Y index starts at x and y minimum in std CMS coordinate system.

Definition at line 798 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE().

CollHandle<EEDigiCollection> EcalSelectiveReadoutValidation::eeNoZsDigis_
private
CollHandle<RecHitCollection> EcalSelectiveReadoutValidation::eeRecHits_
private
bool EcalSelectiveReadoutValidation::eeRuActive_[nEndcaps][nEeX/scEdge][nEeY/scEdge]
private

Definition at line 770 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and anaDigiInit().

CollHandle<std::vector<PCaloHit> > EcalSelectiveReadoutValidation::eeSimHits_
private
CollHandle<EESrFlagCollection> EcalSelectiveReadoutValidation::eeSrFlags_
private
int EcalSelectiveReadoutValidation::eeZsThr_
private

ZS threshold in 1/4th ADC count for EE

Definition at line 694 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), bookHistograms(), and EcalSelectiveReadoutValidation().

const EcalElectronicsMapping* EcalSelectiveReadoutValidation::elecMap_
private

Ecal electronics/geometrical mapping.

Definition at line 673 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh(), dccId(), dqmBeginRun(), and readOutUnitOf().

CollHandle<FEDRawDataCollection> EcalSelectiveReadoutValidation::fedRaw_
private
int EcalSelectiveReadoutValidation::firstFIRSample_
private

Time position of the first sample to use in zero suppession FIR filter. Numbering starts at 0.

Definition at line 703 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), analyzeEE(), and configFirWeights().

std::vector<int> EcalSelectiveReadoutValidation::firWeights_
private

Weights to be used for the ZS FIR filter

Definition at line 686 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), analyzeEE(), and configFirWeights().

std::string EcalSelectiveReadoutValidation::histDir_
private

Histogram directory PATH in DQM or within the output ROOT file

Definition at line 815 of file EcalSelectiveReadoutValidation.h.

std::set<std::string> EcalSelectiveReadoutValidation::histList_
private

List of enabled histograms. Special name "all" is used to indicate all available histograms.

Definition at line 807 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), EcalSelectiveReadoutValidation(), and registerHist().

int EcalSelectiveReadoutValidation::ievt_
private

Event sequence number

Definition at line 781 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), analyzeEB(), and analyzeEE().

bool EcalSelectiveReadoutValidation::isRuComplete_[nDccs_][nDccChs_]
private

Definition at line 773 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), analyzeEB(), and analyzeEE().

const int EcalSelectiveReadoutValidation::kByte_ = 1024
staticprivate

number of bytes in 1 kByte:

Definition at line 413 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume().

int64_t EcalSelectiveReadoutValidation::l1aOfTmax
private

Definition at line 532 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

int64_t EcalSelectiveReadoutValidation::l1aOfTmin
private

Definition at line 531 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

bool EcalSelectiveReadoutValidation::l1aRateErr
private

Definition at line 533 of file EcalSelectiveReadoutValidation.h.

bool EcalSelectiveReadoutValidation::localReco_
private

Local reconstruction switch: true to reconstruct locally the amplitude insted of using the Rec Hits.

Definition at line 678 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and analyzeEE().

std::vector<bool> EcalSelectiveReadoutValidation::logErrForDccs_
private

List of TCC masks for validation If tccMasks[iTcc-1] is false then TCC is considered to have been out of the run and related validations are skipped.

Definition at line 714 of file EcalSelectiveReadoutValidation.h.

Referenced by compareSrfColl(), and selectFedsForLog().

bool EcalSelectiveReadoutValidation::logSrApplicationErrors_
private

Switch to log SR decision that fails to be applied on data: inconstitencies between SRF and number of read out crystals.

Definition at line 858 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and initAsciiFile().

bool EcalSelectiveReadoutValidation::logSrpAlgoErrors_
private

Switch to log in an ascii file inconsistencies found between SRFs read from data and SRFs obtained by rerunning SRP algorithm on TTFs.

Definition at line 853 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and initAsciiFile().

const int EcalSelectiveReadoutValidation::maxDccId_ = minDccId_ + nDccs_ -1
staticprivate

Definition at line 426 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), dccCh(), and getCrystalCount().

MonitorElement* EcalSelectiveReadoutValidation::meChOcc_
private

Definition at line 552 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meCompleteZS_
private

Definition at line 603 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meCompleteZSCnt_
private

Definition at line 615 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meCompleteZSMap_
private

Definition at line 607 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), and checkSrApplication().

MonitorElement* EcalSelectiveReadoutValidation::meCompleteZSRateMap_
private

Definition at line 611 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), and checkSrApplication().

MonitorElement* EcalSelectiveReadoutValidation::meDccHiVol_
private

Definition at line 541 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meDccLiVol_
private

Definition at line 540 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meDccVol_
private

The histograms

Definition at line 539 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meDccVolFromData_
private

Definition at line 542 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meDroppedFRO_
private

Definition at line 602 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meDroppedFROCnt_
private

Definition at line 614 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meDroppedFROMap_
private

Definition at line 606 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), and checkSrApplication().

MonitorElement* EcalSelectiveReadoutValidation::meDroppedFRORateMap_
private

Definition at line 610 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), and checkSrApplication().

MonitorElement* EcalSelectiveReadoutValidation::meEbEMean_
private

Definition at line 561 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbFixedPayload_
private

Event payload that do not depend on the number of crystals passing the SR

Definition at line 628 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meEbFullRoCnt_
private

Definition at line 588 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbHiZsFir_
private

Definition at line 592 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbIncompleteRUZsFir_
private

Definition at line 593 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meEbLiZsFir_
private

Definition at line 591 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbNoise_
private

Definition at line 562 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbNoZsRecVsSimE_
private

Definition at line 566 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbRecE_
private

Definition at line 560 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbRecEHitXtal_
private

Definition at line 564 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbRecVsSimE_
private

Definition at line 565 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbSimE_
private

Definition at line 563 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbZsErrCnt_
private

Definition at line 616 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEbZsErrType1Cnt_
private

Definition at line 619 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeEMean_
private

Definition at line 569 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeFixedPayload_
private

Definition at line 629 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meEeFullRoCnt_
private

Definition at line 589 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeHiZsFir_
private

Definition at line 596 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeLiZsFir_
private

Definition at line 595 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeNoise_
private

Definition at line 570 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeNoZsRecVsSimE_
private

Definition at line 574 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeRecE_
private

Definition at line 568 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeRecEHitXtal_
private

Definition at line 572 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeRecVsSimE_
private

Definition at line 573 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeSimE_
private

Definition at line 571 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeZsErrCnt_
private

Definition at line 617 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meEeZsErrType1Cnt_
private

Definition at line 620 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meFixedPayload_
private

Definition at line 630 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meForcedRu_
private

Definition at line 578 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meForcedTtf_
private

Definition at line 583 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meFullRoCnt_
private

Definition at line 587 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meFullRoRu_
private

Definition at line 576 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meHiTtf_
private

Definition at line 582 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meIncompleteFRO_
private

Definition at line 601 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meIncompleteFROCnt_
private

Definition at line 613 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meIncompleteFROMap_
private

Definition at line 605 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), and checkSrApplication().

MonitorElement* EcalSelectiveReadoutValidation::meIncompleteFRORateMap_
private

Definition at line 609 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), and checkSrApplication().

MonitorElement* EcalSelectiveReadoutValidation::meL1aRate_
private

Estimate of L1A rate

Definition at line 635 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), and endRun().

MonitorElement* EcalSelectiveReadoutValidation::meLiTtf_
private

Definition at line 580 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meMiTtf_
private

Definition at line 581 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meSRFlagsComputed_
private

Definition at line 598 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meSRFlagsConsistency_
private

Definition at line 599 of file EcalSelectiveReadoutValidation.h.

Referenced by bookHistograms(), and compareSrfColl().

MonitorElement* EcalSelectiveReadoutValidation::meSRFlagsFromData_
private

Definition at line 597 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meTp_
private

Definition at line 554 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meTpMap_
private

Definition at line 585 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meTpVsEtSum_
private

Definition at line 558 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meTtf_
private

Definition at line 555 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meTtfVsEtSum_
private

Definition at line 557 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meTtfVsTp_
private

Definition at line 556 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meVol_
private

Definition at line 543 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meVolB_
private

Definition at line 544 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meVolBHI_
private

Definition at line 549 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meVolBLI_
private

Definition at line 546 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meVolE_
private

Definition at line 545 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meVolEHI_
private

Definition at line 550 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meVolELI_
private

Definition at line 547 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meVolHI_
private

Definition at line 551 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meVolLI_
private

Definition at line 548 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meZs1Ru_
private

Definition at line 577 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), analyzeEE(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meZsErrCnt_
private

Definition at line 618 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalSelectiveReadoutValidation::meZsErrType1Cnt_
private

Definition at line 621 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and bookHistograms().

const int EcalSelectiveReadoutValidation::minDccId_ = 1
staticprivate
int EcalSelectiveReadoutValidation::nCompleteZS_
private

Counter of ZS-flagged RU fully read out.

Definition at line 644 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and checkSrApplication().

const unsigned EcalSelectiveReadoutValidation::nDccChs_ = 68
staticprivate

Number of input channels of a DCC.

Definition at line 420 of file EcalSelectiveReadoutValidation.h.

const int EcalSelectiveReadoutValidation::nDccRus_
staticprivate
Initial value:
={
34, 32, 33, 33, 32, 34, 33, 34, 33,
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
32, 33, 33, 32, 34, 33, 34, 33, 34
}

number of RUs for each DCC

Definition at line 441 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume().

const unsigned EcalSelectiveReadoutValidation::nDccs_ = 54
staticprivate

Total number of DCCs.

Definition at line 416 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), bookHistograms(), getEeEventSize(), and selectFedsForLog().

int EcalSelectiveReadoutValidation::nDroppedFRO_
private

Counter of FRO-flagged RU dropped from data.

Definition at line 638 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and checkSrApplication().

int EcalSelectiveReadoutValidation::nEb_
private

ECAL barrel read channel count

Definition at line 718 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

const int EcalSelectiveReadoutValidation::nEbDccs = 36
staticprivate

number of DCCs for EB

Definition at line 429 of file EcalSelectiveReadoutValidation.h.

Referenced by getEbEventSize(), and getEeEventSize().

const int EcalSelectiveReadoutValidation::nEbEta = 170
staticprivate

number of crystals along Eta in EB

Definition at line 447 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB().

int EcalSelectiveReadoutValidation::nEbFROCnt_
private

Counter of EB FRO-flagged RUs.

Definition at line 647 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEB().

int EcalSelectiveReadoutValidation::nEbHI_
private

ECAL barrel high interest read channel count

Definition at line 738 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

int EcalSelectiveReadoutValidation::nEbLI_
private

ECAL barrel low interest read channel count

Definition at line 734 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

const int EcalSelectiveReadoutValidation::nEbPhi = 360
staticprivate

number of crystals along Phi in EB

Definition at line 450 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB().

const int EcalSelectiveReadoutValidation::nEbRus = 36*68
staticprivate

number of RUs for EB

Definition at line 435 of file EcalSelectiveReadoutValidation.h.

const int EcalSelectiveReadoutValidation::nEbTtEta = 34
staticprivate

Number of Trigger Towers in barrel along Eta.

Definition at line 468 of file EcalSelectiveReadoutValidation.h.

int EcalSelectiveReadoutValidation::nEbZsErrors_
private

Counter of EB ZS errors (LI channel below ZS threshold)

Definition at line 653 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEB().

int EcalSelectiveReadoutValidation::nEbZsErrorsType1_
private

Counter of EB ZS errors of type 1: LI channel below ZS threshold and in a RU which was fully readout

Definition at line 660 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEB().

int EcalSelectiveReadoutValidation::nEe_
private

ECAL endcap read channel count

Definition at line 722 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

const int EcalSelectiveReadoutValidation::nEeDccs = 18
staticprivate

number of DCCs for EE

Definition at line 432 of file EcalSelectiveReadoutValidation.h.

Referenced by getEbEventSize(), and getEeEventSize().

int EcalSelectiveReadoutValidation::nEeFROCnt_
private

Counter of EE FRO-flagged RUs.

Definition at line 650 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEE().

int EcalSelectiveReadoutValidation::nEeHI_
private

ECAL endcap high interest read channel count

Definition at line 730 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

int EcalSelectiveReadoutValidation::nEeLI_
private

ECAL endcap low interest read channel count

Definition at line 726 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

const int EcalSelectiveReadoutValidation::nEeRus = 2*(34+32+33+33+32+34+33+34+33)
staticprivate

number of RUs for EE

Definition at line 438 of file EcalSelectiveReadoutValidation.h.

const int EcalSelectiveReadoutValidation::nEeX = 100
staticprivate

EE crystal grid size along X.

Definition at line 453 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE().

const int EcalSelectiveReadoutValidation::nEeY = 100
staticprivate

EE crystal grid size along Y.

Definition at line 456 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE().

int EcalSelectiveReadoutValidation::nEeZsErrors_
private

Counter of EE ZS errors (LI channel below ZS threshold)

Definition at line 656 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEE().

int EcalSelectiveReadoutValidation::nEeZsErrorsType1_
private

Counter of EE ZS errors of tyoe 1: LI channel below ZS threshold and in a RU which was fully readout

Definition at line 664 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEE().

const int EcalSelectiveReadoutValidation::nEndcaps = 2
staticprivate

number of endcaps

Definition at line 444 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE().

int EcalSelectiveReadoutValidation::nHiPerDcc_[nDccs_]
private

read-out ECAL Hiugh interest channel count for each DCC:

Definition at line 750 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

int EcalSelectiveReadoutValidation::nHiRuPerDcc_[nDccs_]
private

Count for each DCC of HI RUs with at leat one channel read out:

Definition at line 763 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

int EcalSelectiveReadoutValidation::nIncompleteFRO_
private

Counter of FRO-flagged RU only partial data.

Definition at line 641 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and checkSrApplication().

int EcalSelectiveReadoutValidation::nLiPerDcc_[nDccs_]
private

read-out ECAL Low interest channel count for each DCC:

Definition at line 746 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

int EcalSelectiveReadoutValidation::nLiRuPerDcc_[nDccs_]
private

Count for each DCC of LI RUs with at leat one channel read out:

Definition at line 759 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

const int EcalSelectiveReadoutValidation::nMaxXtalPerRu = 25
staticprivate

Number of crystals per Readout Unit excepted partial SCs.

Definition at line 477 of file EcalSelectiveReadoutValidation.h.

const int EcalSelectiveReadoutValidation::nOneEeTtEta = 11
staticprivate

Number of Trigger Towers in an endcap along Eta.

Definition at line 465 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh().

int EcalSelectiveReadoutValidation::nPerDcc_[nDccs_]
private

read-out ECAL channel count for each DCC:

Definition at line 742 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and analyzeDataVolume().

int EcalSelectiveReadoutValidation::nPerRu_[nDccs_][nDccChs_]
private

Number of crystal read for each DCC channel (aka readout unit).

Definition at line 777 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), analyzeDataVolume(), and checkSrApplication().

int EcalSelectiveReadoutValidation::nRuPerDcc_[nDccs_]
private

Count for each DCC of RUs with at leat one channel read out:

Definition at line 755 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), anaDigiInit(), and getRuCount().

const int EcalSelectiveReadoutValidation::nTtEta = 2*nOneEeTtEta + nEbTtEta
staticprivate

Number of Trigger Towers along Eta.

Definition at line 471 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and setTtEtSums().

const int EcalSelectiveReadoutValidation::nTtPhi = 72
staticprivate

Number of Trigger Towers along Phi.

Definition at line 474 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and setTtEtSums().

std::string EcalSelectiveReadoutValidation::outputFile_
private

Output file for histograms.

Definition at line 485 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

const double EcalSelectiveReadoutValidation::rad2deg = 45./atan(1.)
staticprivate

Conversion factor from radian to degree.

Definition at line 479 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and analyzeEE().

const int EcalSelectiveReadoutValidation::scEdge = 5
staticprivate

Number of crystals along a supercrystal edge.

Definition at line 462 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi().

bool EcalSelectiveReadoutValidation::SkipInnerSC_
private

Permits to skip inner SC

Definition at line 802 of file EcalSelectiveReadoutValidation.h.

std::ofstream EcalSelectiveReadoutValidation::srApplicationErrorLog_
private

Output ascii file for unconsistency between Xtals and RU Flags.

Definition at line 502 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), analyzeEE(), checkSrApplication(), initAsciiFile(), and selectFedsForLog().

std::string EcalSelectiveReadoutValidation::srApplicationErrorLogFileName_
private

Output ascii file name for unconsistency between SRFs and actual number of read-out crystals.

Definition at line 496 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and initAsciiFile().

std::ofstream EcalSelectiveReadoutValidation::srpAlgoErrorLog_
private

Output ascii file for unconsistency on SR flags.

Definition at line 499 of file EcalSelectiveReadoutValidation.h.

Referenced by compareSrfColl(), initAsciiFile(), and selectFedsForLog().

std::string EcalSelectiveReadoutValidation::srpAlgoErrorLogFileName_
private

Output ascii file name for unconsistency between SRFs read from data and SRF obtained by rerunning SRP algorithm on TTFs.

Definition at line 492 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and initAsciiFile().

int64_t EcalSelectiveReadoutValidation::tmax
private

For L1A rate estimate

Definition at line 529 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

int64_t EcalSelectiveReadoutValidation::tmin
private

Definition at line 530 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

bool EcalSelectiveReadoutValidation::tpInGeV_
private

Switch for uncompressing TP value

Definition at line 698 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and bookHistograms().

CollHandle<EcalTrigPrimDigiCollection> EcalSelectiveReadoutValidation::tps_
private
const EcalTrigTowerConstituentsMap* EcalSelectiveReadoutValidation::triggerTowerMap_
private

ECAL trigger tower mapping

Definition at line 669 of file EcalSelectiveReadoutValidation.h.

Referenced by dqmBeginRun(), readOutUnitOf(), and setTtEtSums().

double EcalSelectiveReadoutValidation::ttEtSums[nTtEta][nTtPhi]
private

Trigger tower Et computed as sum the crystal Et. Indices stands for the eta and phi TT index starting from 0 at eta minimum and at phi=0+ in std CMS coordinate system.

Definition at line 787 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and setTtEtSums().

bool EcalSelectiveReadoutValidation::useEventRate_
private

Switch to fill histograms with event rate instead of event count. Applies only to some histograms.

Definition at line 708 of file EcalSelectiveReadoutValidation.h.

bool EcalSelectiveReadoutValidation::verbose_
private

Verbosity switch.

Definition at line 482 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

std::vector<double> EcalSelectiveReadoutValidation::weights_
private

Weights for amplitude local reconstruction

Definition at line 682 of file EcalSelectiveReadoutValidation.h.

Referenced by frame2Energy().

bool EcalSelectiveReadoutValidation::withEbSimHit_
private

Indicates if EB sim hits are available

Definition at line 829 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEB().

bool EcalSelectiveReadoutValidation::withEeSimHit_
private

Indicates if EE sim hits are available

Definition at line 825 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEE().

std::ofstream EcalSelectiveReadoutValidation::zsErrorLog_
private

File to log ZS and other errors.

Definition at line 505 of file EcalSelectiveReadoutValidation.h.