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:
edm::EDAnalyzer edm::EDConsumerBase

Classes

struct  energiesEb_t
 
struct  energiesEe_t
 
class  Sorter
 

Public Member Functions

 EcalSelectiveReadoutValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalSelectiveReadoutValidation ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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)
 Analyzes the event. More...
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 Calls at begin of run. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 Calls at end of run. More...
 
- 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 myAna ()
 
void normalizeHists (double eventCount)
 
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 SRFlagValidation (const edm::Event &event, const edm::EventSetup &es)
 
EcalScDetId superCrystalOf (const EEDetId &xtalId) const
 
void updateL1aRate (const edm::Event &event)
 
EcalTrigTowerDetId readOutUnitOf (const EBDetId &xtalId) const
 
EcalScDetId readOutUnitOf (const EEDetId &xtalId) const
 
MonitorElementbookFloat (const std::string &name)
 
MonitorElementbook1D (const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
 
MonitorElementbook2D (const std::string &name, const std::string &title, int nxbins, double xmin, double xmax, int nybins, double ymin, double ymax)
 
MonitorElementbookProfile (const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
 
MonitorElementbookProfile2D (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...
 
DQMStoredbe_
 Histogramming interface. 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 EcalTPParameters * tpParam_
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 47 of file EcalSelectiveReadoutValidation.h.

Member Typedef Documentation

Definition at line 52 of file EcalSelectiveReadoutValidation.h.

Definition at line 51 of file EcalSelectiveReadoutValidation.h.

Member Enumeration Documentation

distinguishes barral and endcap of ECAL.

Enumerator
EB 
EE 

Definition at line 75 of file EcalSelectiveReadoutValidation.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 95 of file EcalSelectiveReadoutValidation.cc.

References allHists_, availableHistList_, book1D(), book2D(), bookFloat(), bookProfile(), bookProfile2D(), configFirWeights(), edm::EDConsumerBase::consumesCollector(), dbe_, EB, ebComputedSrFlags_, ebDigis_, ebNoZsDigis_, ebRecHits_, ebSimHits_, ebSrFlags_, ebZsThr_, EE, eeComputedSrFlags_, eeDigis_, eeNoZsDigis_, eeRecHits_, eeSimHits_, eeSrFlags_, eeZsThr_, fedRaw_, MonitorElement::Fill(), getDccOverhead(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), histDir_, histList_, logSrApplicationErrors_, logSrpAlgoErrors_, meChOcc_, meCompleteZSCnt_, meCompleteZSMap_, meCompleteZSRateMap_, meDccHiVol_, meDccLiVol_, meDccVol_, meDccVolFromData_, meDroppedFROCnt_, meDroppedFROMap_, meDroppedFRORateMap_, meEbEMean_, meEbFixedPayload_, meEbFullRoCnt_, meEbHiZsFir_, meEbLiZsFir_, meEbNoise_, meEbNoZsRecVsSimE_, meEbRecE_, meEbRecEHitXtal_, meEbRecVsSimE_, meEbSimE_, meEbZsErrCnt_, meEbZsErrType1Cnt_, meEeEMean_, meEeFixedPayload_, meEeFullRoCnt_, meEeHiZsFir_, meEeLiZsFir_, meEeNoise_, meEeNoZsRecVsSimE_, meEeRecE_, meEeRecEHitXtal_, meEeRecVsSimE_, meEeSimE_, meEeZsErrCnt_, meEeZsErrType1Cnt_, meFixedPayload_, 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_, nEbDccs, nEeDccs, cppFunctionSkipper::operator, outputFile_, printAvailableHists(), alignCSCRings::s, CollHandle< T >::setToken(), srApplicationErrorLogFileName_, srpAlgoErrorLogFileName_, AlCaHLTBitMon_QueryRunRegistry::string, edmStreamStallGrapher::t, indexGen::title, tpInGeV_, tps_, and verbose_.

95  :
96  collNotFoundWarn_(ps.getUntrackedParameter<bool>("warnIfCollectionNotFound", true)),
97  ebDigis_(ps.getParameter<edm::InputTag>("EbDigiCollection"), false,
99  eeDigis_(ps.getParameter<edm::InputTag>("EeDigiCollection"), false,
101  ebNoZsDigis_(ps.getParameter<edm::InputTag>("EbUnsuppressedDigiCollection"),
102  false, false/*collNotFoundWarn_*/),
103  eeNoZsDigis_(ps.getParameter<edm::InputTag>("EeUnsuppressedDigiCollection"),
104  false, false/*collNotFoundWarn_*/),
105  ebSrFlags_(ps.getParameter<edm::InputTag>("EbSrFlagCollection"), false,
107  eeSrFlags_(ps.getParameter<edm::InputTag>("EeSrFlagCollection"), false,
109  ebComputedSrFlags_(ps.getParameter<edm::InputTag>("EbSrFlagFromTTCollection"), false,
110  false/*collNotFoundWarn_*/),
111  eeComputedSrFlags_(ps.getParameter<edm::InputTag>("EeSrFlagFromTTCollection"), false,
112  false/*collNotFoundWarn_*/),
113  ebSimHits_(ps.getParameter<edm::InputTag>("EbSimHitCollection"), false,
114  false/*collNotFoundWarn_*/),
115  eeSimHits_(ps.getParameter<edm::InputTag>("EeSimHitCollection"), false,
116  false/*collNotFoundWarn_*/),
117  tps_(ps.getParameter<edm::InputTag>("TrigPrimCollection"), false,
119  ebRecHits_(ps.getParameter<edm::InputTag>("EbRecHitCollection"), false,
120  false/*collNotFoundWarn_*/),
121  eeRecHits_(ps.getParameter<edm::InputTag>("EeRecHitCollection"), false,
122  false/*collNotFoundWarn_*/),
123  fedRaw_(ps.getParameter<edm::InputTag>("FEDRawCollection"), false,
124  false/*collNotFoundWarn_*/),
125  tmax(0),
127  l1aOfTmin(0),
128  l1aOfTmax(0),
129  triggerTowerMap_(0),
130  localReco_(ps.getParameter<bool>("LocalReco")),
131  weights_(ps.getParameter<vector<double> >("weights")),
132  tpInGeV_(ps.getParameter<bool>("tpInGeV")),
133  firstFIRSample_(ps.getParameter<int>("ecalDccZs1stSample")),
134  useEventRate_(ps.getParameter<bool>("useEventRate")),
135  logErrForDccs_(nDccs_, false),
136  ievt_(0),
137  allHists_(false),
138  histDir_(ps.getParameter<string>("histDir")),
139  withEeSimHit_(false),
140  withEbSimHit_(false){
141 
143  ebDigis_.setToken(collector);
144  eeDigis_.setToken(collector);
145  ebNoZsDigis_.setToken(collector);
146  eeNoZsDigis_.setToken(collector);
147  ebSrFlags_.setToken(collector);
148  eeSrFlags_.setToken(collector);
149  ebComputedSrFlags_.setToken(collector);
150  eeComputedSrFlags_.setToken(collector);
151  ebSimHits_.setToken(collector);
152  eeSimHits_.setToken(collector);
153  tps_.setToken(collector);
154  ebRecHits_.setToken(collector);
155  eeRecHits_.setToken(collector);
156  fedRaw_.setToken(collector);
157 
158  PgTiming t("EcalSelectiveReadoutValidation ctor");
159 
160 // std::vector<int> excludedFeds =
161 // ps.getParameter<vector<int> >("excludedFeds");
162 
163 // for(size_t i = 0; i < excludedFeds.size(); ++i){
164 // int iDcc = excludedFeds[i] % 600;
165 // if(iDcc < minDccId_ || iDcc > maxDccId_){
166 // throw cms::Exception("config") << "Error in parameter excludedFeds of "
167 // "EcalSelectiveReadoutValidation module. Values must be between "
168 // << 600 + minDccId_
169 // << " and " << 600 + maxDccId_ << "\n";
170 // } else{
171 // logErrForDccs_.at(iDcc-minDccId_) = false;
172 // }
173 // }
174 
175  double ebZsThr = ps.getParameter<double>("ebZsThrADCCount");
176  double eeZsThr = ps.getParameter<double>("eeZsThrADCCount");
177 
178  ebZsThr_ = lround(ebZsThr*4);
179  eeZsThr_ = lround(eeZsThr*4);
180 
181  //File to log SRP algorithem inconsistency
183  = ps.getUntrackedParameter<string>("srpAlgoErrorLogFile","");
185 
186  //File to log SRP decision application inconsistency
188  = ps.getUntrackedParameter<string>("srApplicationErrorLogFile","");
190 
191  //FIR ZS weights
192  configFirWeights(ps.getParameter<vector<double> >("dccWeights"));
193 
194  // DQM ROOT output
195  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
196 
197  if(outputFile_.size() != 0){
198  LogInfo("OutputInfo") << " Ecal Digi Task histograms will be saved to '"
199  << outputFile_.c_str() << "'";
200  } else{
201  LogInfo("OutputInfo") << " Ecal Digi Task histograms will NOT be saved";
202  }
203 
204  // verbosity switch
205  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
206 
207  // get hold of back-end interface
209 
210  if(verbose_){
211  dbe_->setVerbose(1);
212  } else{
213  dbe_->setVerbose(0);
214  }
215 
217 
219 
220  vector<string>
221  hists(ps.getUntrackedParameter<vector<string> >("histograms",
222  vector<string>(1, "all")));
223 
224  for(vector<string>::iterator it = hists.begin();
225  it!=hists.end(); ++it) histList_.insert(*it);
226  if(histList_.find("all") != histList_.end()) allHists_ = true;
227 
228  //Data volume
229  meEbFixedPayload_ = bookFloat("ebFixedVol");
230  double ebFixed = getDccOverhead(EB)*nEbDccs;
231  double eeFixed = getDccOverhead(EE)*nEeDccs;
232  meEbFixedPayload_->Fill(ebFixed);
233  meEeFixedPayload_ = bookFloat("eeFixedVol");
234  meEbFixedPayload_->Fill(eeFixed);
235  meFixedPayload_ = bookFloat("fixedVol");
236  meFixedPayload_->Fill(ebFixed+eeFixed);
237 
238  meL1aRate_ = bookFloat("l1aRate_");
239 
240  meDccVol_ = bookProfile("hDccVol", //"EcalDccEventSizeComputed",
241  "ECAL DCC event fragment size;Dcc id; "
242  "<Event size> (kB)", nDccs_, .5, .5+nDccs_);
243 
244  meDccLiVol_ = bookProfile("hDccLiVol",
245  "LI channel payload per DCC;Dcc id; "
246  "<Event size> (kB)", nDccs_, .5, .5+nDccs_);
247 
248  meDccHiVol_ = bookProfile("hDccHiVol",
249  "HI channel payload per DCC;Dcc id; "
250  "<Event size> (kB)", nDccs_, .5, .5+nDccs_);
251 
252  meDccVolFromData_ = bookProfile("hDccVolFromData", //"EcalDccEventSize",
253  "ECAL DCC event fragment size;Dcc id; "
254  "<Event size> (kB)", nDccs_, .5, .5+nDccs_);
255 
256  meVolBLI_ = book1D("hVolBLI",// "EBLowInterestPayload",
257  "ECAL Barrel low interest crystal data payload;"
258  "Event size (kB);Nevts",
259  100, 0., 200.);
260 
261  meVolELI_ = book1D("hVolELI", //"EELowInterestPayload",
262  "Endcap low interest crystal data payload;"
263  "Event size (kB);Nevts",
264  100, 0., 200.);
265 
266  meVolLI_ = book1D("hVolLI", //"EcalLowInterestPayload",
267  "ECAL low interest crystal data payload;"
268  "Event size (kB);Nevts",
269  100, 0., 200.);
270 
271  meVolBHI_ = book1D("hVolBHI", //"EBHighInterestPayload",
272  "Barrel high interest crystal data payload;"
273  "Event size (kB);Nevts",
274  100, 0., 200.);
275 
276  meVolEHI_ = book1D("hVolEHI", //"EEHighInterestPayload",
277  "Endcap high interest crystal data payload;"
278  "Event size (kB);Nevts",
279  100, 0., 200.);
280 
281  meVolHI_ = book1D("hVolHI", //"EcalHighInterestPayload",
282  "ECAL high interest crystal data payload;"
283  "Event size (kB);Nevts",
284  100, 0., 200.);
285 
286  meVolB_ = book1D("hVolB", //"EBEventSize",
287  "Barrel data volume;Event size (kB);Nevts",
288  100, 0., 200.);
289 
290  meVolE_ = book1D("hVolE", //"EEEventSize",
291  "Endcap data volume;Event size (kB);Nevts",
292  100, 0., 200.);
293 
294  meVol_ = book1D("hVol", //"EcalEventSize",
295  "ECAL data volume;Event size (kB);Nevts",
296  100, 0., 200.);
297 
298  meChOcc_ = book2D("h2ChOcc", //"EcalChannelOccupancy",
299  "ECAL crystal channel occupancy after zero suppression;"
300  "iX -200 / iEta / iX + 100;"
301  "iY / iPhi (starting from -10^{o}!);"
302  "Event count",
303  401, -200.5, 200.5,
304  360, .5, 360.5);
305 
306  //TP
307  string tpUnit;
308  if(tpInGeV_) tpUnit = string("GeV"); else tpUnit = string("TP hw unit");
309  string title;
310  title = string("Trigger primitive TT E_{T};E_{T} ")
311  + tpUnit + string(";Event Count");
312  meTp_ = book1D("hTp", //"EcalTriggerPrimitiveEt",
313  title.c_str(),
314  (tpInGeV_?100:40), 0., (tpInGeV_?10.:40.));
315 
316  meTtf_ = book1D("hTtf", //"EcalTriggerTowerFlag",
317  "Trigger primitive TT flag;Flag number;Event count",
318  8, -.5, 7.5);
319 
320  title = string("Trigger tower flag vs TP;E_{T}(TT) (")
321  + tpUnit + string(");Flag number");
322  meTtfVsTp_ = book2D("h2TtfVsTp",
323  title.c_str(),
324  100, 0., (tpInGeV_?10.:40.),
325  8, -.5, 7.5);
326 
327  meTtfVsEtSum_ = book2D("h2TtfVsEtSum",
328  "Trigger tower flag vs #sumE_{T};"
329  "E_{T}(TT) (GeV);"
330  "TTF",
331  100, 0., 10.,
332  8, -.5, 7.5);
333  title = string("Trigger primitive Et (TP) vs #sumE_{T};"
334  "E_{T} (sum) (GeV);"
335  "E_{T} (TP) (") + tpUnit + string (")");
336 
337  meTpVsEtSum_ = book2D("h2TpVsEtSum",
338  title.c_str(),
339  100, 0., 10.,
340  100, 0., (tpInGeV_?10.:40.));
341 
342  title = string("Trigger primitive E_{T};"
343  "iEta;"
344  "iPhi;"
345  "E_{T} (TP) (") + tpUnit + string (")");
346  meTpMap_ = bookProfile2D("h2Tp",
347  title.c_str(),
348  57, -28.5, 28.5,
349  72, .5, 72.5);
350 
351  //SRF
352  meFullRoRu_ = book2D("h2FRORu", //"EcalFullReadoutSRFlagMap",
353  "Full Read-out readout unit;"
354  "iX - 40 / iEta / iX + 20;"
355  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
356  "Event count",
357  80, -39.5, 40.5,
358  72, .5, 72.5);
359 
360  meFullRoCnt_ = book1D("hFROCnt",
361  "Number of Full-readout-flagged readout units;"
362  "FRO RU count;Event count",
363  300, -.5, 299.5);
364 
365  meEbFullRoCnt_ = book1D("hEbFROCnt",
366  "Number of EB Full-readout-flagged readout units;"
367  "FRO RU count;Event count",
368  200, -.5, 199.5);
369 
370  meEeFullRoCnt_ = book1D("hEeFROCnt",
371  "Number of EE Full-readout-flagged readout units;"
372  "FRO RU count;Event count",
373  200, -.5, 199.5);
374 
375  meZs1Ru_ = book2D("h2Zs1Ru", //"EbZeroSupp1SRFlagMap",
376  "Readout unit with ZS-thr-1 flag;"
377  "iX - 40 / iEta / iX + 20;"
378  "iY0 / iPhi0 (iPhi = 1 at phi = 0 rad);"
379  "Event count",
380  80, -39.5, 40.5,
381  72, .5, 72.5);
382 
383  meForcedRu_ = book2D("h2ForcedRu", //"EcalReadoutUnitForcedBitMap",
384  "ECAL readout unit with forced bit of SR flag on;"
385  "iX - 40 / iEta / iX + 20;"
386  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
387  "Event count",
388  80, -39.5, 40.5,
389  72, .5, 72.5);
390 
391  meLiTtf_ = book2D("h2LiTtf", //"EcalLowInterestTriggerTowerFlagMap",
392  "Low interest trigger tower flags;"
393  "iEta;"
394  "iPhi;"
395  "Event count",
396  57, -28.5, 28.5,
397  72, .5, 72.5);
398 
399  meMiTtf_ = book2D("h2MiTtf", //"EcalMidInterestTriggerTowerFlagMap",
400  "Mid interest trigger tower flags;"
401  "iEta;"
402  "iPhi;"
403  "Event count",
404  57, -28.5, 28.5,
405  72, .5, 72.5);
406 
407  meHiTtf_ = book2D("h2HiTtf", //"EcalHighInterestTriggerTowerFlagMap",
408  "High interest trigger tower flags;"
409  "iEta;"
410  "iPhi;"
411  "Event count",
412  57, -28.5, 28.5,
413  72, .5, 72.5);
414 
415  meForcedTtf_ = book2D("h2ForcedTtf", //"EcalTtfForcedBitMap",
416  "Trigger tower flags with forced bit set;"
417  "iEta;"
418  "iPhi;"
419  "Event count",
420  57, -28.5, 28.5,
421  72, .5, 72.5);
422 
423 
424  const float ebMinNoise = -1.;
425  const float ebMaxNoise = 1.;
426 
427  const float eeMinNoise = -1.;
428  const float eeMaxNoise = 1.;
429 
430 #if 0
431  const float ebMinE = 0.;
432  const float ebMaxE = 120.;
433 
434  const float eeMinE = 0.;
435  const float eeMaxE = 120.;
436 #else
437  const float ebMinE = ebMinNoise;
438  const float ebMaxE = ebMaxNoise;
439 
440  const float eeMinE = eeMinNoise;
441  const float eeMaxE = eeMaxNoise;
442 #endif
443 
444 
445  const int evtMax = 500;
446 
447  meEbRecE_ = book1D("hEbRecE",
448  "Crystal reconstructed energy;E (GeV);Event count",
449  100, ebMinE, ebMaxE);
450 
451  meEbEMean_ = bookProfile("hEbEMean",
452  "EE <E_hit>;event #;<E_hit> (GeV)",
453  evtMax, .5, evtMax + .5);
454 
455  meEbNoise_ = book1D("hEbNoise",
456  "Crystal noise "
457  "(rec E of crystal without deposited energy)"
458  ";Rec E (GeV);Event count",
459  100, ebMinNoise, ebMaxNoise);
460 
461  meEbLiZsFir_ = book1D("zsEbLiFIRemu",
462  "Emulated ouput of ZS FIR filter for EB "
463  "low interest crystals;"
464  "ADC count*4;"
465  "Event count",
466  60, -30, 30);
467 
468  meEbHiZsFir_ = book1D("zsEbHiFIRemu",
469  "Emulated ouput of ZS FIR filter for EB "
470  "high interest crystals;"
471  "ADC count*4;"
472  "Event count",
473  60, -30, 30);
474 
475  //TODO: Fill this histogram...
476 // meEbIncompleteRUZsFir_ = book1D("zsEbIncompleteRUFIRemu",
477 // "Emulated ouput of ZS FIR filter for EB "
478 // "incomplete FRO-flagged RU;"
479 // "ADC count*4;"
480 // "Event count",
481 // 60, -30, 30);
482 
483  meEbSimE_ = book1D("hEbSimE", "EB hit crystal simulated energy",
484  100, ebMinE, ebMaxE);
485 
486  meEbRecEHitXtal_ = book1D("hEbRecEHitXtal",
487  "EB rec energy of hit crystals",
488  100, ebMinE, ebMaxE);
489 
490  meEbRecVsSimE_ = book2D("hEbRecVsSimE",
491  "Crystal simulated vs reconstructed energy;"
492  "Esim (GeV);Erec GeV);Event count",
493  100, ebMinE, ebMaxE,
494  100, ebMinE, ebMaxE);
495 
496  meEbNoZsRecVsSimE_ = book2D("hEbNoZsRecVsSimE",
497  "Crystal no-zs simulated vs reconstructed "
498  "energy;"
499  "Esim (GeV);Erec GeV);Event count",
500  100, ebMinE, ebMaxE,
501  100, ebMinE, ebMaxE);
502 
503  meEeRecE_ = book1D("hEeRecE",
504  "EE crystal reconstructed energy;E (GeV);"
505  "Event count",
506  100, eeMinE, eeMaxE);
507 
508  meEeEMean_ = bookProfile("hEeEMean",
509  "<E_{EE hit}>;event;<E_{hit}> (GeV)",
510  evtMax, .5, evtMax + .5);
511 
512 
513  meEeNoise_ = book1D("hEeNoise",
514  "EE crystal noise "
515  "(rec E of crystal without deposited energy);"
516  "E (GeV);Event count",
517  200, eeMinNoise, eeMaxNoise);
518 
519  meEeLiZsFir_ = book1D("zsEeLiFIRemu",
520  "Emulated ouput of ZS FIR filter for EE "
521  "low interest crystals;"
522  "ADC count*4;"
523  "Event count",
524  60, -30, 30);
525 
526  meEeHiZsFir_ = book1D("zsEeHiFIRemu",
527  "Emulated ouput of ZS FIR filter for EE "
528  "high interest crystals;"
529  "ADC count*4;"
530  "Event count",
531  60, -30, 30);
532 
533  //TODO: Fill this histogram...
534 // meEeIncompleteRUZsFir_ = book1D("zsEeIncompleteRUFIRemu",
535 // "Emulated ouput of ZS FIR filter for EE "
536 // "incomplete FRO-flagged RU;"
537 // "ADC count*4;"
538 // "Event count",
539 // 60, -30, 30);
540 
541 
542  meEeSimE_ = book1D("hEeSimE", "EE hit crystal simulated energy",
543  100, eeMinE, eeMaxE);
544 
545  meEeRecEHitXtal_ = book1D("hEeRecEHitXtal",
546  "EE rec energy of hit crystals",
547  100, eeMinE, eeMaxE);
548 
549  meEeRecVsSimE_ = book2D("hEeRecVsSimE",
550  "EE crystal simulated vs reconstructed energy;"
551  "Esim (GeV);Erec GeV);Event count",
552  100, eeMinE, eeMaxE,
553  100, eeMinE, eeMaxE);
554 
555  meEeNoZsRecVsSimE_ = book2D("hEeNoZsRecVsSimE",
556  "EE crystal no-zs simulated vs "
557  "reconstructed "
558  "energy;Esim (GeV);Erec GeV);Event count",
559  100, eeMinE, eeMaxE,
560  100, eeMinE, eeMaxE);
561 
562  meSRFlagsConsistency_ = book2D("hSRAlgoErrorMap",
563  "TTFlags and SR Flags mismatch;"
564  "iX - 40 / iEta / iX + 20;"
565  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
566  "Event count",
567  80, -39.5, 40.5,
568  72, .5, 72.5);
569 
570  //Readout Units histos (interest/Ncrystals)
571  meIncompleteFROMap_ = book2D("hIncompleteFROMap",
572  "Incomplete full-readout-flagged readout units;"
573  "iX - 40 / iEta / iX + 20;"
574  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
575  "Event count",
576  80, -39.5, 40.5,
577  72, .5, 72.5);
578 
579  meIncompleteFROCnt_ = book1D("hIncompleteFROCnt",
580  "Number of incomplete full-readout-flagged "
581  "readout units;"
582  "Number of RUs;Event count;",
583  200, -.5, 199.5);
584 
586  = bookProfile2D("hIncompleteFRORateMap",
587  "Incomplete full-readout-flagged readout units;"
588  "iX - 40 / iEta / iX + 20;"
589  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
590  "Incomplete error rate",
591  80, -39.5, 40.5,
592  72, .5, 72.5);
593 
594 
595  meDroppedFROMap_ = book2D("hDroppedFROMap",
596  "Dropped full-readout-flagged readout units;"
597  "iX - 40 / iEta / iX + 20;"
598  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
599  "Event count",
600  80, -39.5, 40.5,
601  72, .5, 72.5);
602 
603  meDroppedFROCnt_ = book1D("hDroppedFROCnt",
604  "Number of dropped full-readout-flagged "
605  "RU count;RU count;Event count",
606  200, -.5, 199.5);
607 
608  meCompleteZSCnt_ = book1D("hCompleteZsCnt",
609  "Number of zero-suppressed-flagged RU fully "
610  "readout;"
611  "RU count;Event count",
612  200, -.5, 199.5);
613 
614  stringstream buf;
615  buf << "Number of LI EB channels below the " << ebZsThr_/4. << " ADC count ZS threshold;"
616  "Channel count;Event count",
617  meEbZsErrCnt_ = book1D("hEbZsErrCnt",
618  buf.str().c_str(),
619  200, -.5, 199.5);
620 
621  buf.str("");
622  buf << "Number of LI EE channels below the " << eeZsThr_/4. << " ADC count ZS theshold;"
623  "Channel count;Event count",
624  meEeZsErrCnt_ = book1D("hEeZsErrCnt",
625  buf.str().c_str(),
626  200, -.5, 199.5);
627 
628  meZsErrCnt_ = book1D("hZsErrCnt",
629  "Number of LI channels below the ZS threshold;"
630  "Channel count;Event count",
631  200, -.5, 199.5);
632 
633  meEbZsErrType1Cnt_ = book1D("hEbZsErrType1Cnt",
634  "Number of EB channels below the ZS "
635  "threshold in a LI but fully readout RU;"
636  "Channel count;Event count;",
637  200, -.5, 199.5);
638 
639  meEeZsErrType1Cnt_ = book1D("hEeZsErrType1Cnt",
640  "Number EE channels below the ZS threshold"
641  " in a LI but fully readout RU;"
642  "Channel count;Event count",
643  200, -.5, 199.5);
644 
645  meZsErrType1Cnt_ = book1D("hZsErrType1Cnt",
646  "Number of LI channels below the ZS threshold "
647  "in a LI but fully readout RU;"
648  "Channel count;Event count",
649  200, -.5, 199.5);
650 
651 
653  = bookProfile2D("hDroppedFRORateMap",
654  "Dropped full-readout-flagged readout units"
655  "iX - 40 / iEta / iX + 20;"
656  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
657  "Dropping rate",
658  80, -39.5, 40.5,
659  72, .5, 72.5);
660 
661  meCompleteZSMap_ = book2D("hCompleteZSMap",
662  "Complete zero-suppressed-flagged readout units;"
663  "iX - 40 / iEta / iX + 20;"
664  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
665  "Event count",
666  80, -39.5, 40.5,
667  72, .5, 72.5);
668 
670  = bookProfile2D("hCompleteZSRate",
671  "Complete zero-suppressed-flagged readout units;"
672  "iX - 40 / iEta / iX + 20;"
673  "iY / iPhi (iPhi = 1 at phi = 0 rad);"
674  "Completeness rate",
675  80, -39.5, 40.5,
676  72, .5, 72.5);
677 
678  //print list of available histograms (must be called after
679  //the bookXX methods):
681 
682  //check the histList parameter:
683  stringstream s;
684  for(set<string>::iterator it = histList_.begin();
685  it!=histList_.end();
686  ++it){
687  if(*it!=string("all")
688  && availableHistList_.find(*it)==availableHistList_.end()){
689  s << (s.str().size()==0?"":", ") << *it;
690  }
691  }
692  if(s.str().size()!=0){
693  LogWarning("Configuration")
694  << "Parameter 'histList' contains some unknown histogram(s). "
695  "Check spelling. Following name were not found: "
696  << s.str();
697  }
698 }
void configFirWeights(const std::vector< double > &weightsForZsFIR)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * bookProfile(const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
CollHandle< EBDigiCollection > ebNoZsDigis_
double getDccOverhead(subdet_t subdet) const
CollHandle< EcalTrigPrimDigiCollection > tps_
bool collNotFoundWarn_
Switch for collection-not-found warning.
CollHandle< FEDRawDataCollection > fedRaw_
static const int nEeDccs
number of DCCs for EE
MonitorElement * book1D(const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
void Fill(long long x)
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_
DQMStore * dbe_
Histogramming interface.
void setVerbose(unsigned level)
Definition: DQMStore.cc:631
MonitorElement * bookFloat(const std::string &name)
MonitorElement * book2D(const std::string &name, const std::string &title, int nxbins, double xmin, double xmax, int nybins, double ymin, double ymax)
CollHandle< EESrFlagCollection > eeSrFlags_
static const int nEbDccs
number of DCCs for EB
CollHandle< std::vector< PCaloHit > > ebSimHits_
CollHandle< EEDigiCollection > eeNoZsDigis_
std::map< std::string, std::string > availableHistList_
void setToken(edm::ConsumesCollector &collector)
Definition: CollHandle.h:49
void showDirStructure(void) const
Definition: DQMStore.cc:3332
CollHandle< EBDigiCollection > ebDigis_
static const unsigned nDccs_
Total number of DCCs.
const EcalTrigTowerConstituentsMap * triggerTowerMap_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
CollHandle< RecHitCollection > ebRecHits_
CollHandle< EBSrFlagCollection > ebComputedSrFlags_
MonitorElement * bookProfile2D(const std::string &name, const std::string &title, int nbinx, double xmin, double xmax, int nbiny, double ymin, double ymax, const char *option="")
EcalSelectiveReadoutValidation::~EcalSelectiveReadoutValidation ( )

Destructor.

Definition at line 1375 of file EcalSelectiveReadoutValidation.cc.

1375  {
1376 }

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 1526 of file EcalSelectiveReadoutValidation.cc.

References Reference_intrackfit_cff::barrel, dccCh(), ebRuActive_, ebTtEdge, EcalBarrel, eeRuActive_, edm::hlt::Exception, archive::flag, 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().

1527  {
1528  const DetId& xtalId = frame.id();
1529  typedef typename U::key_type RuDetId;
1530  const RuDetId& ruId = readOutUnitOf(frame.id());
1531  typename U::const_iterator srf = srFlagColl.find(ruId);
1532 
1533  bool highInterest = false;
1534  int flag = 0;
1535 
1536  if(srf != srFlagColl.end()){
1537  // throw cms::Exception("EcalSelectiveReadoutValidation")
1538  // << __FILE__ << ":" << __LINE__ << ": SR flag not found";
1539  // }
1540 
1541  flag = srf->value() & ~EcalSrFlag::SRF_FORCED_MASK;
1542 
1543  highInterest = (flag == EcalSrFlag::SRF_FULL);
1544 
1545  }
1546 
1547  bool barrel = (xtalId.subdetId()==EcalBarrel);
1548 
1549  pair<int,int> ch = dccCh(xtalId);
1550 
1551  if(barrel){
1552  ++nEb_;
1553  if(highInterest){
1554  ++nEbHI_;
1555  } else{//low interest
1556  ++nEbLI_;
1557  }
1558  int iEta0 = iEta2cIndex(static_cast<const EBDetId&>(xtalId).ieta());
1559  int iPhi0 = iPhi2cIndex(static_cast<const EBDetId&>(xtalId).iphi());
1560  if(!ebRuActive_[iEta0/ebTtEdge][iPhi0/ebTtEdge]){
1561  ++nRuPerDcc_[ch.first-minDccId_];
1562  if(highInterest){
1563  // fill(meFullRoRu_, ruGraphX(ruId), ruGraphY(ruId));
1564  ++nHiRuPerDcc_[ch.first-minDccId_];
1565  } else{
1566  ++nLiRuPerDcc_[ch.first-minDccId_];
1567  }
1568 // if(flag & EcalSrFlag::SRF_FORCED_MASK){
1569 // fill(meForcedRu_, ruGraphX(ruId), ruGraphY(ruId));
1570 // }
1571 // if(flag == EcalSrFlag::SRF_ZS1){
1572 // fill(meZs1Ru_, ruGraphX(ruId), ruGraphY(ruId));
1573 // }
1574  ebRuActive_[iEta0/ebTtEdge][iPhi0/ebTtEdge] = true;
1575  }
1576  } else{//endcap
1577  ++nEe_;
1578  if(highInterest){
1579  ++nEeHI_;
1580  } else{//low interest
1581  ++nEeLI_;
1582  }
1583  int iX0 = iXY2cIndex(static_cast<const EEDetId&>(frame.id()).ix());
1584  int iY0 = iXY2cIndex(static_cast<const EEDetId&>(frame.id()).iy());
1585  int iZ0 = static_cast<const EEDetId&>(frame.id()).zside()>0?1:0;
1586 
1587  if(!eeRuActive_[iZ0][iX0/scEdge][iY0/scEdge]){
1588  ++nRuPerDcc_[ch.first-minDccId_];
1589  if(highInterest){
1590  // fill(meFullRoRu_, ruGraphX(ruId), ruGraphY(ruId));
1591  ++nHiRuPerDcc_[ch.first-minDccId_];
1592  } else{
1593  ++nLiRuPerDcc_[ch.first-minDccId_];
1594  }
1595 // if(flag == EcalSrFlag::SRF_ZS1){
1596 // fill(meZs1Ru_, ruGraphX(ruId), ruGraphY(ruId));
1597 // }
1598 // if(srf->value() & EcalSrFlag::SRF_FORCED_MASK){
1599 // fill(meForcedRu_, ruGraphX(ruId), ruGraphY(ruId));
1600 // }
1601  eeRuActive_[iZ0][iX0/scEdge][iY0/scEdge] = true;
1602  }
1603  }
1604 
1605  if(ch.second < 1 || ch.second > 68){
1606  throw cms::Exception("EcalSelectiveReadoutValidation")
1607  << "Error in DCC channel retrieval for crystal with detId "
1608  << xtalId.rawId() << "DCC channel out of allowed range [1..68]\n";
1609  }
1610  ++nPerDcc_[ch.first-minDccId_];
1611  ++nPerRu_[ch.first-minDccId_][ch.second-1];
1612  if(highInterest){
1613  ++nHiPerDcc_[ch.first-minDccId_];
1614  } else{//low interest channel
1615  ++nLiPerDcc_[ch.first-minDccId_];
1616  }
1617 }
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 1619 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyzeDataVolume().

1619  {
1620  nEb_ = 0;
1621  nEe_ = 0;
1622  nEeLI_ = 0;
1623  nEeHI_ = 0;
1624  nEbLI_ = 0;
1625  nEbHI_ = 0;
1626  bzero(nPerDcc_, sizeof(nPerDcc_));
1627  bzero(nLiPerDcc_, sizeof(nLiPerDcc_));
1628  bzero(nHiPerDcc_, sizeof(nHiPerDcc_));
1629  bzero(nRuPerDcc_, sizeof(nRuPerDcc_));
1630  bzero(ebRuActive_, sizeof(ebRuActive_));
1631  bzero(eeRuActive_, sizeof(eeRuActive_));
1632  bzero(nPerRu_, sizeof(nPerRu_));
1633  bzero(nLiRuPerDcc_, sizeof(nLiRuPerDcc_));
1634  bzero(nHiRuPerDcc_, sizeof(nHiRuPerDcc_));
1635 }
bool ebRuActive_[nEbEta/ebTtEdge][nEbPhi/ebTtEdge]
bool eeRuActive_[nEndcaps][nEeX/scEdge][nEeY/scEdge]
void EcalSelectiveReadoutValidation::analyze ( edm::Event const &  e,
edm::EventSetup const &  c 
)
protectedvirtual

Analyzes the event.

Implements edm::EDAnalyzer.

Definition at line 727 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(), edmStreamStallGrapher::t, tps_, updateL1aRate(), withEbSimHit_, and withEeSimHit_.

728  {
729 
731 
732  {
733  PgTiming t("collection readout");
734 
735  //retrieves event products:
737 
738  }
739 
740  withEeSimHit_ = (eeSimHits_->size()!=0);
741  withEbSimHit_ = (ebSimHits_->size()!=0);
742 
743  if(ievt_<10){
744  edm::LogInfo("EcalSrValid") << "Size of TP collection: " << tps_->size() << "\n"
745  << "Size of EB SRF collection read from data: "
746  << ebSrFlags_->size() << "\n"
747  << "Size of EB SRF collection computed from data TTFs: "
748  << ebComputedSrFlags_->size() << "\n"
749  << "Size of EE SRF collection read from data: "
750  << eeSrFlags_->size() << "\n"
751  << "Size of EE SRF collection computed from data TTFs: "
752  << eeComputedSrFlags_->size() << "\n";
753  }
754 
755  if(ievt_==0){
756  selectFedsForLog(); //note: must be called after readAllCollection
757  }
758 
759  //computes Et sum trigger tower crystals:
761 
762  {
763  PgTiming t("data volume analysis");
764 
765  //Data Volume
767  }
768 
769  {
770  PgTiming t("EB analysis");
771  //EB digis
772  //must be called after analyzeDataVolume because it uses
773  //isRuComplete_ array that this method fills
774  analyzeEB(event, es);
775  }
776 
777  {
778  PgTiming t("EE analysis");
779  //EE digis
780  //must be called after analyzeDataVolume because it uses
781  //isRuComplete_ array that this method fills
782  analyzeEE(event, es);
783  }
784 
788 
792 
796 
797  {
798  PgTiming t("TP analysis");
799  //TP
800  analyzeTP(event, es);
801  }
802 
803  //SR Consistency and validation
804  //SRFlagValidation(event,es);
805  if(ebComputedSrFlags_->size()){
807  }
808  if(eeComputedSrFlags_->size()){
810  }
811  nDroppedFRO_ = 0;
812  nIncompleteFRO_ = 0;
813  nCompleteZS_ = 0;
819  ++ievt_;
820 }
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 1460 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().

1461  {
1462 
1463  anaDigiInit();
1464 
1465 
1466  //Complete RU, i.e. RU actually fully readout
1467  for(int iDcc = minDccId_; iDcc <= maxDccId_; ++iDcc){
1468  for(int iCh = 1; iCh < nDccRus_[iDcc-minDccId_]; ++iCh){
1469  isRuComplete_[iDcc-minDccId_][iCh-1]
1470  = (nPerRu_[iDcc-minDccId_][iCh-1]==getCrystalCount(iDcc, iCh));
1471  }
1472  }
1473 
1474 
1475  //Barrel
1476  for (unsigned int digis=0; digis<ebDigis_->size(); ++digis){
1477  EBDataFrame ebdf = (*ebDigis_)[digis];
1478  anaDigi(ebdf, *ebSrFlags_);
1479  }
1480 
1481  // Endcap
1482  for (unsigned int digis=0; digis<eeDigis_->size(); ++digis){
1483  EEDataFrame eedf = (*eeDigis_)[digis];
1484  anaDigi(eedf, *eeSrFlags_);
1485  }
1486 
1487  //histos
1488  for(unsigned iDcc0 = 0; iDcc0 < nDccs_; ++iDcc0){
1489  fill(meDccVol_, iDcc0+1, getDccEventSize(iDcc0, nPerDcc_[iDcc0])/kByte_);
1490  fill(meDccLiVol_, iDcc0+1,
1491  getDccSrDependentPayload(iDcc0, nLiRuPerDcc_[iDcc0],
1492  nLiPerDcc_[iDcc0])/kByte_);
1493  fill(meDccHiVol_, iDcc0+1,
1494  getDccSrDependentPayload(iDcc0, nHiRuPerDcc_[iDcc0],
1495  nHiPerDcc_[iDcc0])/kByte_);
1496  const FEDRawDataCollection& raw = *fedRaw_;
1497  fill(meDccVolFromData_, iDcc0+1,
1498  ((double)raw.FEDData(601+iDcc0).size())/kByte_);
1499  }
1500 
1501 
1502  //low interesest channels:
1503  double a = nEbLI_*getBytesPerCrystal()/kByte_; //getEbEventSize(nEbLI_)/kByte_;
1504  fill(meVolBLI_, a);
1505  double b = nEeLI_*getBytesPerCrystal()/kByte_; //getEeEventSize(nEeLI_)/kByte_;
1506  fill(meVolELI_, b);
1507  fill(meVolLI_, a+b);
1508 
1509  //high interest chanels:
1510  a = nEbHI_*getBytesPerCrystal()/kByte_; //getEbEventSize(nEbHI_)/kByte_;
1511  fill(meVolBHI_, a);
1512  b = nEeHI_*getBytesPerCrystal()/kByte_; //getEeEventSize(nEeHI_)/kByte_;
1513  fill(meVolEHI_, b);
1514  fill(meVolHI_, a+b);
1515 
1516  //any-interest channels:
1517  a = getEbEventSize(nEb_)/kByte_;
1518  fill(meVolB_, a);
1519  b = getEeEventSize(nEe_)/kByte_;
1520  fill(meVolE_, b);
1521  fill(meVol_, a+b);
1522 }
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 1076 of file EcalSelectiveReadoutValidation.cc.

References 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, edm::hlt::Exception, fill(), firstFIRSample_, firWeights_, archive::flag, frame2Energy(), EcalSelectiveReadoutValidation::energiesEb_t::gain12, ecalMGPA::gainId(), geometry, edm::EventSetup::get(), CaloSubdetectorGeometry::getGeometry(), i, EBDataFrame::id(), EBSrFlag::id(), PCaloHit::id(), EcalRecHit::id(), 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, ruGraphX(), ruGraphY(), alignCSCRings::s, EcalSelectiveReadoutValidation::energiesEb_t::simE, EcalSelectiveReadoutValidation::energiesEb_t::simHit, EcalDataFrame::size(), srApplicationErrorLog_, EcalSrFlag::SRF_FORCED_MASK, EcalSrFlag::SRF_FULL, EcalSrFlag::SRF_ZS1, PgTiming::stop(), edmStreamStallGrapher::t, findQualityFiles::v, EcalSrFlag::value(), withEbSimHit_, xtalGraphX(), xtalGraphY(), and EcalTrigTowerDetId::zside().

Referenced by analyze().

1077  {
1078 
1079  bool eventError = false;
1080  nEbZsErrors_ = 0;
1081  vector<pair<int,int> > xtalEtaPhi;
1082 
1083  {
1084  PgTiming t("analyzeEB: init");
1085 
1086  xtalEtaPhi.reserve(nEbPhi*nEbEta);
1087  for(int iEta0=0; iEta0<nEbEta; ++iEta0){
1088  for(int iPhi0=0; iPhi0<nEbPhi; ++iPhi0){
1089  ebEnergies[iEta0][iPhi0].noZsRecE = -numeric_limits<double>::max();
1090  ebEnergies[iEta0][iPhi0].recE = -numeric_limits<double>::max();
1091  ebEnergies[iEta0][iPhi0].simE = 0; //must be zero.
1092  ebEnergies[iEta0][iPhi0].simHit = 0;
1093  ebEnergies[iEta0][iPhi0].gain12 = false;
1094  xtalEtaPhi.push_back(pair<int,int>(iEta0, iPhi0));
1095  }
1096  }
1097  }
1098 
1099  // get the barrel geometry:
1100  edm::ESHandle<CaloGeometry> geoHandle;
1101 
1102  PgTiming t1("analyzeEB: geomRetrieval");
1103  es.get<MyCaloGeometryRecord>().get(geoHandle);
1104  const CaloSubdetectorGeometry *geometry_p
1105  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
1106  CaloSubdetectorGeometry const& geometry = *geometry_p;
1107  t1.stop();
1108 
1109 
1110  {
1111  PgTiming t("analyzeEB: unsuppressed digi loop");
1112  //EB unsuppressed digis:
1114  it != ebNoZsDigis_->end(); ++it){
1115  const EBDataFrame& frame = *it;
1116  int iEta0 = iEta2cIndex(static_cast<const EBDetId&>(frame.id()).ieta());
1117  int iPhi0 = iPhi2cIndex(static_cast<const EBDetId&>(frame.id()).iphi());
1118  if(iEta0<0 || iEta0>=nEbEta){
1119  stringstream s;
1120  s << "EcalSelectiveReadoutValidation: "
1121  << "iEta0 (= " << iEta0 << ") is out of range ("
1122  << "[0," << nEbEta -1 << "]\n";
1123  throw cms::Exception(s.str());
1124  }
1125  if(iPhi0<0 || iPhi0>=nEbPhi){
1126  stringstream s;
1127  s << "EcalSelectiveReadoutValidation: "
1128  << "iPhi0 (= " << iPhi0 << ") is out of range ("
1129  << "[0," << nEbPhi -1 << "]\n";
1130  throw cms::Exception(s.str());
1131  }
1132 
1133  ebEnergies[iEta0][iPhi0].noZsRecE = frame2Energy(frame);
1134  ebEnergies[iEta0][iPhi0].gain12 = true;
1135  for(int i = 0; i< frame.size(); ++i){
1136  const int gain12Code = 0x1;
1137  if(frame[i].gainId()!=gain12Code) ebEnergies[iEta0][iPhi0].gain12 = false;
1138  }
1139 
1140  const GlobalPoint xtalPos
1141  = geometry.getGeometry(frame.id())->getPosition();
1142 
1143  ebEnergies[iEta0][iPhi0].phi = rad2deg*((double)xtalPos.phi());
1144  ebEnergies[iEta0][iPhi0].eta = xtalPos.eta();
1145  } //next non-zs digi
1146  }
1147 
1148 
1149  {
1150  PgTiming t("analyzeEB: simHit loop");
1151  //EB sim hits
1152  for(vector<PCaloHit>::const_iterator it = ebSimHits_->begin();
1153  it != ebSimHits_->end(); ++it){
1154  const PCaloHit& simHit = *it;
1155  EBDetId detId(simHit.id());
1156  int iEta = detId.ieta();
1157  int iEta0 =iEta2cIndex(iEta);
1158  int iPhi = detId.iphi();
1159  int iPhi0 = iPhi2cIndex(iPhi);
1160  ebEnergies[iEta0][iPhi0].simE += simHit.energy();
1161  ++ebEnergies[iEta0][iPhi0].simHit;
1162  }
1163  }
1164 
1165  bool crystalShot[nEbEta][nEbPhi];
1166  {
1167  PgTiming t("analyzeEB: suppressed digi loop init");
1168 
1169  for(int iEta0=0; iEta0<nEbEta; ++iEta0){
1170  for(int iPhi0=0; iPhi0<nEbPhi; ++iPhi0){
1171  crystalShot[iEta0][iPhi0] = false;
1172  }
1173  }
1174  }
1175 
1176  int nEbDigi = 0;
1177 
1178  {
1179  PgTiming t("analyzeEB: suppressed digi loop");
1180 
1182  it != ebDigis_->end(); ++it){
1183  ++nEbDigi;
1184  const EBDataFrame& frame = *it;
1185  int iEta = static_cast<const EBDetId&>(frame.id()).ieta();
1186  int iPhi = static_cast<const EBDetId&>(frame.id()).iphi();
1187  int iEta0 = iEta2cIndex(iEta);
1188  int iPhi0 = iPhi2cIndex(iPhi);
1189  if(iEta0<0 || iEta0>=nEbEta){
1190  throw (cms::Exception("EcalSelectiveReadoutValidation")
1191  << "iEta0 (= " << iEta0 << ") is out of range ("
1192  << "[0," << nEbEta -1 << "]");
1193  }
1194  if(iPhi0<0 || iPhi0>=nEbPhi){
1195  throw (cms::Exception("EcalSelectiveReadoutValidation")
1196  << "iPhi0 (= " << iPhi0 << ") is out of range ("
1197  << "[0," << nEbPhi -1 << "]");
1198  }
1199  assert(iEta0>=0 && iEta0<nEbEta);
1200  assert(iPhi0>=0 && iPhi0<nEbPhi);
1201  if(!crystalShot[iEta0][iPhi0]){
1202  crystalShot[iEta0][iPhi0] = true;
1203  } else{
1204  cout << "Error: several digi for same crystal!";
1205  abort();
1206  }
1207  if(localReco_){
1208  ebEnergies[iEta0][iPhi0].recE = frame2Energy(frame);
1209  }
1210 
1211  ebEnergies[iEta0][iPhi0].gain12 = true;
1212  for(int i = 0; i< frame.size(); ++i){
1213  const int gain12Code = 0x1;
1214  if(frame[i].gainId()!=gain12Code){
1215  ebEnergies[iEta0][iPhi0].gain12 = false;
1216  }
1217  }
1218 
1219  fill(meChOcc_, xtalGraphX(frame.id()), xtalGraphY(frame.id()));
1221  = ebSrFlags_->find(readOutUnitOf(frame.id()));
1222 
1223  bool highInterest = false;
1224 
1225  // if(srf == ebSrFlags_->end()){
1226  // throw cms::Exception("EcalSelectiveReadoutValidation")
1227  // << __FILE__ << ":" << __LINE__ << ": SR flag not found";
1228  //}
1229 
1230  if(srf != ebSrFlags_->end()){
1231  highInterest = ((srf->value() & ~EcalSrFlag::SRF_FORCED_MASK)
1233  }
1234 
1235 
1236  if(highInterest){
1238  } else{
1239  int v = dccZsFIR(frame, firWeights_, firstFIRSample_, 0);
1240  fill(meEbLiZsFir_, v);
1241  if(v < ebZsThr_){
1242  eventError = true;
1243  ++nEbZsErrors_;
1244  pair<int,int> ru = dccCh(frame.id());
1245  if(isRuComplete_[ru.first][ru.second-1]) ++nEbZsErrorsType1_;
1246  if(nEbZsErrors_ < 3){
1247  srApplicationErrorLog_ << event.id() << ", "
1248  << "RU " << frame.id() << ", "
1249  << "DCC " << ru.first
1250  << " Ch : " << ru.second << ": "
1251  << "LI channel under ZS threshold.\n";
1252  }
1253  if(nEbZsErrors_==3){
1254  srApplicationErrorLog_ << event.id() << ": "
1255  << "more ZS errors for this event...\n";
1256  }
1257  }
1258  }
1259  } //next EB digi
1260  }
1261 
1262 
1263  {
1264  PgTiming t("analyzeEB: rec hit loop");
1265 
1266  if(!localReco_){
1268  = ebRecHits_->begin();
1269  it != ebRecHits_->end(); ++it){
1270  ++nEbDigi;
1271  const RecHit& hit = *it;
1272  int iEta = static_cast<const EBDetId&>(hit.id()).ieta();
1273  int iPhi = static_cast<const EBDetId&>(hit.id()).iphi();
1274  int iEta0 = iEta2cIndex(iEta);
1275  int iPhi0 = iPhi2cIndex(iPhi);
1276  if(iEta0<0 || iEta0>=nEbEta){
1277  LogError("EcalSrValid") << "iEta0 (= " << iEta0 << ") is out of range ("
1278  << "[0," << nEbEta -1 << "]\n";
1279  }
1280  if(iPhi0<0 || iPhi0>=nEbPhi){
1281  LogError("EcalSrValid") << "iPhi0 (= " << iPhi0 << ") is out of range ("
1282  << "[0," << nEbPhi -1 << "]\n";
1283  }
1284  ebEnergies[iEta0][iPhi0].recE = hit.energy();
1285  }
1286  }
1287  }
1288 
1289 
1290 // {
1291 // PgTiming t("analyzeEB: crystal sorting");
1292 
1293 // //sorts crystal in increasing sim hit energy. ebEnergies[][].simE
1294 // //must be set beforehand:
1295 // sort(xtalEtaPhi.begin(), xtalEtaPhi.end(), Sorter(this));
1296 // cout << "\niEta\tiPhi\tsimE\tnoZsE\tzsE\n";
1297 // }
1298 
1299 
1300  {
1301  PgTiming t("analyzeEB: loop on energies");
1302 
1303  for(unsigned int i=0; i<xtalEtaPhi.size(); ++i){
1304  int iEta0 = xtalEtaPhi[i].first;
1305  int iPhi0= xtalEtaPhi[i].second;
1306  energiesEb_t& energies = ebEnergies[iEta0][iPhi0];
1307 
1308  double recE = energies.recE;
1309  if(recE!=-numeric_limits<double>::max()){//not zero suppressed
1310  fill(meEbRecE_, ebEnergies[iEta0][iPhi0].recE);
1311  fill(meEbEMean_, ievt_+1, recE);
1312  } //not zero suppressed
1313 
1314  if(withEbSimHit_){
1315  if(!energies.simHit){//noise only crystal channel
1316  fill(meEbNoise_, energies.noZsRecE);
1317  } else{
1318  fill(meEbSimE_, energies.simE);
1319  fill(meEbRecEHitXtal_, energies.recE);
1320  }
1321  fill(meEbRecVsSimE_, energies.simE, energies.recE);
1322  fill(meEbNoZsRecVsSimE_, energies.simE, energies.noZsRecE);
1323  }
1324  }
1325  }
1326 
1327  {
1328  PgTiming t("analyzeEB: SRF");
1329  //SRF
1330  nEbFROCnt_ = 0;
1331  char ebSrfMark[2][17][72];
1332  bzero(ebSrfMark, sizeof(ebSrfMark));
1333  // int idbg = 0;
1335  it != ebSrFlags_->end(); ++it){
1336  const EBSrFlag& srf = *it;
1337  int iEtaAbs = srf.id().ietaAbs();
1338  int iPhi = srf.id().iphi();
1339  int iZ = srf.id().zside();
1340 
1341 // cout << "--> " << ++idbg << iEtaAbs << " " << iPhi << " " << iZ
1342 // << " " << srf.id() << "\n";
1343 
1344  if(iEtaAbs < 1 || iEtaAbs > 17
1345  || iPhi < 1 || iPhi > 72) throw cms::Exception("EcalSelectiveReadoutValidation")
1346  << "Found a barrel SRF with an invalid det ID: " << srf.id() << ".\n";
1347  ++ebSrfMark[iZ>0?1:0][iEtaAbs-1][iPhi-1];
1348  if(ebSrfMark[iZ>0?1:0][iEtaAbs-1][iPhi-1] > 1) throw cms::Exception("EcalSelectiveReadoutValidation")
1349  << "Duplicate SRF for RU " << srf.id() << ".\n";
1350  int flag = srf.value() & ~EcalSrFlag::SRF_FORCED_MASK;
1351  if(flag == EcalSrFlag::SRF_ZS1){
1352  fill(meZs1Ru_, ruGraphX(srf.id()), ruGraphY(srf.id()));
1353  }
1354  if(flag == EcalSrFlag::SRF_FULL){
1355  fill(meFullRoRu_, ruGraphX(srf.id()), ruGraphY(srf.id()));
1356  ++nEbFROCnt_;
1357  }
1358  if(srf.value() & EcalSrFlag::SRF_FORCED_MASK){
1359  fill(meForcedRu_, ruGraphX(srf.id()), ruGraphY(srf.id()));
1360  }
1361  }
1362  }
1363 
1364  {
1365  PgTiming t("analyzeEB: logSRerror");
1366 
1367  if(eventError) srApplicationErrorLog_ << event.id()
1368  << ": " << nEbZsErrors_
1369  << " ZS-flagged EB channels under "
1370  "the ZS threshold, whose " << nEbZsErrorsType1_
1371  << " in a complete RU.\n";
1372  }
1373 }
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
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 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
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:55
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
int ruGraphX(const EcalScDetId &id) const
tuple cout
Definition: gather_cfg.py:121
void fill(MonitorElement *me, float x)
int ruGraphY(const EcalScDetId &id) const
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 823 of file EcalSelectiveReadoutValidation.cc.

References edm::DataFrameContainer::begin(), 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, edm::hlt::Exception, fill(), firstFIRSample_, firWeights_, archive::flag, 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, ruGraphX(), ruGraphY(), EcalSelectiveReadoutValidation::energiesEe_t::simE, EcalSelectiveReadoutValidation::energiesEe_t::simHit, EcalDataFrame::size(), edm::DataFrameContainer::size(), srApplicationErrorLog_, EcalSrFlag::SRF_FORCED_MASK, EcalSrFlag::SRF_FULL, EcalSrFlag::SRF_ZS1, edmStreamStallGrapher::t, findQualityFiles::v, EcalSrFlag::value(), withEeSimHit_, xtalGraphX(), xtalGraphY(), EcalScDetId::zside(), EEDetId::zside(), and ecaldqm::zside().

Referenced by analyze().

824  {
825  bool eventError = false;
826  nEeZsErrors_ = 0;
827 
828  {
829  PgTiming t("analyzeEE: init");
830  for(int iZ0=0; iZ0<nEndcaps; ++iZ0){
831  for(int iX0=0; iX0<nEeX; ++iX0){
832  for(int iY0=0; iY0<nEeY; ++iY0){
833  eeEnergies[iZ0][iX0][iY0].noZsRecE = -numeric_limits<double>::max();
834  eeEnergies[iZ0][iX0][iY0].recE = -numeric_limits<double>::max();
835  eeEnergies[iZ0][iX0][iY0].simE = 0; //must be set to zero.
836  eeEnergies[iZ0][iX0][iY0].simHit = 0;
837  eeEnergies[iZ0][iX0][iY0].gain12 = false;
838  }
839  }
840  }
841  }
842 
843  // gets the endcap geometry:
844  edm::ESHandle<CaloGeometry> geoHandle;
845  es.get<MyCaloGeometryRecord>().get(geoHandle);
846  const CaloSubdetectorGeometry *geometry_p
847  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
848  CaloSubdetectorGeometry const& geometry = *geometry_p;
849 
850  {
851  PgTiming t("analyzeEE: unsupressed digis");
852  //EE unsupressed digis:
853  for (unsigned int digis=0; digis<eeNoZsDigis_->size(); ++digis){
854 
855  EEDataFrame frame = (*eeNoZsDigis_)[digis];
856  int iX0 = iXY2cIndex(frame.id().ix());
857  int iY0 = iXY2cIndex(frame.id().iy());
858  int iZ0 = frame.id().zside()>0?1:0;
859 
860  if(iX0<0 || iX0>=nEeX){
861  edm::LogError("EcalSrValid") << "iX0 (= " << iX0 << ") is out of range ("
862  << "[0," << nEeX -1 << "]\n";
863  }
864  if(iY0<0 || iY0>=nEeY){
865  edm::LogError("EcalSrValid") << "iY0 (= " << iY0 << ") is out of range ("
866  << "[0," << nEeY -1 << "]\n";
867  }
868  // cout << "EE no ZS energy computation..." ;
869  eeEnergies[iZ0][iX0][iY0].noZsRecE = frame2Energy(frame);
870 
871  eeEnergies[iZ0][iX0][iY0].gain12 = true;
872  for(int i = 0; i< frame.size(); ++i){
873  const int gain12Code = 0x1;
874  if(frame[i].gainId()!=gain12Code) eeEnergies[iZ0][iX0][iY0].gain12 = false;
875  }
876 
877  const GlobalPoint xtalPos
878  = geometry.getGeometry(frame.id())->getPosition();
879 
880  eeEnergies[iZ0][iX0][iY0].phi = rad2deg*((double)xtalPos.phi());
881  eeEnergies[iZ0][iX0][iY0].eta = xtalPos.eta();
882  }
883  }
884 
885  {
886  PgTiming t("analyzeEE:rec hits");
887  //EE rec hits:
888  if(!localReco_){
890  = eeRecHits_->begin();
891  it != eeRecHits_->end(); ++it){
892  const RecHit& hit = *it;
893  int iX0 = iXY2cIndex(static_cast<const EEDetId&>(hit.id()).ix());
894  int iY0 = iXY2cIndex(static_cast<const EEDetId&>(hit.id()).iy());
895  int iZ0 = static_cast<const EEDetId&>(hit.id()).zside()>0?1:0;
896 
897  if(iX0<0 || iX0>=nEeX){
898  LogError("EcalSrValid") << "iX0 (= " << iX0 << ") is out of range ("
899  << "[0," << nEeX -1 << "]\n";
900  }
901  if(iY0<0 || iY0>=nEeY){
902  LogError("EcalSrValid") << "iY0 (= " << iY0 << ") is out of range ("
903  << "[0," << nEeY -1 << "]\n";
904  }
905  // cout << "EE no ZS energy computation..." ;
906  eeEnergies[iZ0][iX0][iY0].recE = hit.energy();
907  }
908  }
909  }
910 
911  {
912  PgTiming t("analyzeEE:sim hits");
913  //EE sim hits:
914  for(vector<PCaloHit>::const_iterator it = eeSimHits_->begin();
915  it != eeSimHits_->end(); ++it){
916  const PCaloHit& simHit = *it;
917  EEDetId detId(simHit.id());
918  int iX = detId.ix();
919  int iX0 =iXY2cIndex(iX);
920  int iY = detId.iy();
921  int iY0 = iXY2cIndex(iY);
922  int iZ0 = detId.zside()>0?1:0;
923  eeEnergies[iZ0][iX0][iY0].simE += simHit.energy();
924  ++eeEnergies[iZ0][iX0][iY0].simHit;
925  }
926  }
927 
928  {
929  PgTiming t("analyzeEE: suppressed digis");
930 
931  //EE suppressed digis
933  it != eeDigis_->end(); ++it){
934  const EEDataFrame& frame = *it;
935  int iX0 = iXY2cIndex(static_cast<const EEDetId&>(frame.id()).ix());
936  int iY0 = iXY2cIndex(static_cast<const EEDetId&>(frame.id()).iy());
937  int iZ0 = static_cast<const EEDetId&>(frame.id()).zside()>0?1:0;
938  if(iX0<0 || iX0>=nEeX){
939  LogError("EcalSrValid") << "iX0 (= " << iX0 << ") is out of range ("
940  << "[0," << nEeX -1 << "]\n";
941  }
942  if(iY0<0 || iY0>=nEeY){
943  LogError("EcalSrValid") << "iY0 (= " << iY0 << ") is out of range ("
944  << "[0," << nEeY -1 << "]\n";
945  }
946 
947  if(localReco_){
948  eeEnergies[iZ0][iX0][iY0].recE = frame2Energy(frame);
949  }
950 
951  eeEnergies[iZ0][iX0][iY0].gain12 = true;
952  for(int i = 0; i< frame.size(); ++i){
953  const int gain12Code = 0x1;
954  if(frame[i].gainId()!=gain12Code){
955  eeEnergies[iZ0][iX0][iY0].gain12 = false;
956  }
957  }
958 
959  fill(meChOcc_, xtalGraphX(frame.id()), xtalGraphY(frame.id()));
960 
962  = eeSrFlags_->find(readOutUnitOf(frame.id()));
963 
964  bool highInterest = false;
965 
966 
967  if(srf==eeSrFlags_->end()) continue;
968 
969  if(srf!=eeSrFlags_->end()){
970  highInterest = ((srf->value() & ~EcalSrFlag::SRF_FORCED_MASK)
972  }
973 
974  if(highInterest){
976  } else{
977  int v = dccZsFIR(frame, firWeights_, firstFIRSample_, 0);
978  fill(meEeLiZsFir_, v);
979  if(v < eeZsThr_){
980  eventError = true;
981  ++nEeZsErrors_;
982  pair<int,int> ru = dccCh(frame.id());
983  if(isRuComplete_[ru.first][ru.second-1]) ++nEeZsErrorsType1_;
984  if(nEeZsErrors_ < 3){
985  srApplicationErrorLog_ << event.id() << ", "
986  << "RU " << frame.id() << ", "
987  << "DCC " << ru.first
988  << " Ch : " << ru.second << ": "
989  << "LI channel under ZS threshold.\n";
990  }
991  if(nEeZsErrors_==3){
992  srApplicationErrorLog_ << event.id() << ": "
993  << "more ZS errors for this event...\n";
994  }
995  }
996  }
997  } //next ZS digi.
998  }
999 
1000  {
1001  PgTiming t("analyzeEE: energies");
1002 
1003  for(int iZ0=0; iZ0<nEndcaps; ++iZ0){
1004  for(int iX0=0; iX0<nEeX; ++iX0){
1005  for(int iY0=0; iY0<nEeY; ++iY0){
1006  double recE = eeEnergies[iZ0][iX0][iY0].recE;
1007  if(recE==-numeric_limits<double>::max()) continue; //not a crystal or ZS
1008  fill(meEeRecE_, eeEnergies[iZ0][iX0][iY0].recE);
1009 
1010  fill(meEeEMean_, ievt_+1,
1011  eeEnergies[iZ0][iX0][iY0].recE);
1012 
1013  if(withEeSimHit_){
1014  if(!eeEnergies[iZ0][iX0][iY0].simHit){//noise only crystal channel
1015  fill(meEeNoise_, eeEnergies[iZ0][iX0][iY0].noZsRecE);
1016  } else{
1017  fill(meEeSimE_, eeEnergies[iZ0][iX0][iY0].simE);
1018  fill(meEeRecEHitXtal_, eeEnergies[iZ0][iX0][iY0].recE);
1019  }
1020  fill(meEeRecVsSimE_, eeEnergies[iZ0][iX0][iY0].simE,
1021  eeEnergies[iZ0][iX0][iY0].recE);
1022  fill(meEeNoZsRecVsSimE_, eeEnergies[iZ0][iX0][iY0].simE,
1023  eeEnergies[iZ0][iX0][iY0].noZsRecE);
1024  }
1025  }
1026  }
1027  }
1028  }
1029 
1030  {
1031  PgTiming t("analyzeEE: RU");
1032 
1033  nEeFROCnt_ = 0;
1034  char eeSrfMark[2][100][100];
1035  bzero(eeSrfMark, sizeof(eeSrfMark));
1036  //Filling RU histo
1038  it != eeSrFlags_->end(); ++it){
1039  const EESrFlag& srf = *it;
1040  int iX = srf.id().ix();
1041  int iY = srf.id().iy();
1042  int iZ = srf.id().zside(); //-1 for EE-, +1 for EE+
1043  if(iX<1 || iY > 100) throw cms::Exception("EcalSelectiveReadoutValidation")
1044  << "Found an endcap SRF with an invalid det ID: " << srf.id() << ".\n";
1045  ++eeSrfMark[iZ>0?1:0][iX-1][iY-1];
1046  if(eeSrfMark[iZ>0?1:0][iX-1][iY-1] > 1) throw cms::Exception("EcalSelectiveReadoutValidation")
1047  << "Duplicate SRF for supercrystal " << srf.id() << ".\n";
1048  int flag = srf.value() & ~EcalSrFlag::SRF_FORCED_MASK;
1049  if(flag == EcalSrFlag::SRF_ZS1){
1050  fill(meZs1Ru_, ruGraphX(srf.id()), ruGraphY(srf.id()));
1051  }
1052 
1053  if(flag == EcalSrFlag::SRF_FULL){
1054  fill(meFullRoRu_, ruGraphX(srf.id()), ruGraphY(srf.id()));
1055  ++nEeFROCnt_;
1056  }
1057 
1058  if(srf.value() & EcalSrFlag::SRF_FORCED_MASK){
1059  fill(meForcedRu_, ruGraphX(srf.id()), ruGraphY(srf.id()));
1060  }
1061  }
1062  }
1063 
1064  {
1065  PgTiming t("analyzeEE: SR appli error log");
1066 
1067  if(eventError) srApplicationErrorLog_ << event.id()
1068  << ": " << nEeZsErrors_
1069  << " ZS-flagged EE channels under "
1070  "the ZS threshold, whose " << nEeZsErrorsType1_
1071  << " in a complete RU.\n";
1072  }
1073 } //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.
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:55
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
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
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 1399 of file EcalSelectiveReadoutValidation.cc.

References fill(), EcalTPGScale::getTPGInGeV(), iTtEta2cIndex(), meForcedTtf_, meHiTtf_, meLiTtf_, meMiTtf_, meTp_, meTpMap_, meTpVsEtSum_, meTtf_, meTtfVsEtSum_, meTtfVsTp_, EcalTPGScale::setEventSetup(), tpInGeV_, tps_, and ttEtSums.

Referenced by analyze().

1400  {
1401  EcalTPGScale ecalScale;
1402 #if (CMSSW_COMPAT_VERSION>=210)
1403  ecalScale.setEventSetup(es) ;
1404 #endif
1405 
1406  // std::cout << __FILE__ << __LINE__
1407  // << "n TP: " << tps_->size() <<std::endl;
1408 
1410  it != tps_->end(); ++it){
1411  // for(int i = 0; i < it->size(); ++i){
1412  // double v = (*it)[i].raw() & 0xFF;
1413  // if(v>0) std::cout << v << " " << i << std::endl;
1414  //}
1415  // if(it->compressedEt() > 0){
1416  // std::cout << "---------> " << it->id().ieta() << ", "
1417  // << it->id().iphi() << ", "
1418  // << it->compressedEt() << std::endl;
1419  //}
1420 
1421  //const int iTcc = elecMap_->TCCid(it->id());
1422  //const int iTt = elecMap_->iTt(it->id());
1423  double tpEt;
1424  if(tpInGeV_){
1425 #if (CMSSW_COMPAT_VERSION<210)
1426  tpEt = ecalScale.getTPGInGeV(es, *it);
1427 #else
1428  tpEt = ecalScale.getTPGInGeV(it->compressedEt(), it->id()) ;
1429 #endif
1430  } else{
1431  tpEt = it->compressedEt();
1432  }
1433  int iEta = it->id().ieta();
1434  int iEta0 = iTtEta2cIndex(iEta);
1435  int iPhi = it->id().iphi();
1436  int iPhi0 = iTtEta2cIndex(iPhi);
1437  double etSum = ttEtSums[iEta0][iPhi0];
1438  fill(meTp_, tpEt);
1439  fill(meTpVsEtSum_, etSum, tpEt);
1440  fill(meTtf_, it->ttFlag());
1441  if((it->ttFlag() & 0x3) == 0){
1442  fill(meLiTtf_, iEta, iPhi);
1443  }
1444  if((it->ttFlag() & 0x3) == 1){
1445  fill(meMiTtf_, iEta, iPhi);
1446  }
1447  if((it->ttFlag() & 0x3) == 3){
1448  fill(meHiTtf_, iEta, iPhi);
1449  }
1450  if((it->ttFlag() & 0x4)){
1451  fill(meForcedTtf_, iEta, iPhi);
1452  }
1453 
1454  fill(meTtfVsTp_, tpEt, it->ttFlag());
1455  fill(meTtfVsEtSum_, etSum, it->ttFlag());
1456  fill(meTpMap_, iEta, iPhi, tpEt, 1.);
1457  }
1458 }
void setEventSetup(const edm::EventSetup &evtSetup)
Definition: EcalTPGScale.cc:19
CollHandle< EcalTrigPrimDigiCollection > tps_
std::vector< EcalTriggerPrimitiveDigi >::const_iterator const_iterator
double getTPGInGeV(const EcalTriggerPrimitiveDigi &tpDigi)
Definition: EcalTPGScale.cc:24
void fill(MonitorElement *me, float x)
void EcalSelectiveReadoutValidation::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Calls at begin of run.

Reimplemented from edm::EDAnalyzer.

Definition at line 1378 of file EcalSelectiveReadoutValidation.cc.

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

1378  {
1379  // endcap mapping
1381  es.get<IdealGeometryRecord>().get(hTriggerTowerMap);
1382  triggerTowerMap_ = hTriggerTowerMap.product();
1383 
1384  //electronics map
1386  es.get< EcalMappingRcd >().get(ecalmapping);
1387  elecMap_ = ecalmapping.product();
1388 
1389  initAsciiFile();
1390 }
T const * product() const
Definition: ESHandle.h:62
const EcalTrigTowerConstituentsMap * triggerTowerMap_
const EcalElectronicsMapping * elecMap_
MonitorElement * EcalSelectiveReadoutValidation::book1D ( const std::string &  name,
const std::string &  title,
int  nbins,
double  xmin,
double  xmax 
)
private

Definition at line 1949 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::book1D(), dbe_, edm::hlt::Exception, mergeVDriftHistosByStation::name, registerHist(), and query::result.

Referenced by EcalSelectiveReadoutValidation().

1949  {
1950  if(!registerHist(name, title)) return 0; //this histo is disabled
1952  if(result==0){
1953  throw cms::Exception("Histo")
1954  << "Failed to book histogram " << name;
1955  }
1956  return result;
1957 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
bool registerHist(const std::string &name, const std::string &title)
tuple result
Definition: query.py:137
DQMStore * dbe_
Histogramming interface.
MonitorElement * EcalSelectiveReadoutValidation::book2D ( const std::string &  name,
const std::string &  title,
int  nxbins,
double  xmin,
double  xmax,
int  nybins,
double  ymin,
double  ymax 
)
private

Definition at line 1959 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::book2D(), dbe_, edm::hlt::Exception, mergeVDriftHistosByStation::name, registerHist(), and query::result.

Referenced by EcalSelectiveReadoutValidation().

1959  {
1960  if(!registerHist(name, title)) return 0; //this histo is disabled
1962  nybins, ymin, ymax);
1963  if(result==0){
1964  throw cms::Exception("Histo")
1965  << "Failed to book histogram " << name;
1966  }
1967  return result;
1968 }
bool registerHist(const std::string &name, const std::string &title)
tuple result
Definition: query.py:137
DQMStore * dbe_
Histogramming interface.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1082
MonitorElement * EcalSelectiveReadoutValidation::bookFloat ( const std::string &  name)
private

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

Definition at line 1938 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::bookFloat(), dbe_, edm::hlt::Exception, mergeVDriftHistosByStation::name, registerHist(), and query::result.

Referenced by EcalSelectiveReadoutValidation().

1938  {
1939  if(!registerHist(name, "")) return 0; //this histo is disabled
1941  if(result==0){
1942  throw cms::Exception("DQM")
1943  << "Failed to book integer DQM monitor element" << name;
1944  }
1945  return result;
1946 }
bool registerHist(const std::string &name, const std::string &title)
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:891
tuple result
Definition: query.py:137
DQMStore * dbe_
Histogramming interface.
MonitorElement * EcalSelectiveReadoutValidation::bookProfile ( const std::string &  name,
const std::string &  title,
int  nbins,
double  xmin,
double  xmax 
)
private

Definition at line 1970 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::bookProfile(), dbe_, edm::hlt::Exception, mergeVDriftHistosByStation::name, registerHist(), and query::result.

Referenced by EcalSelectiveReadoutValidation().

1970  {
1971  if(!registerHist(name, title)) return 0; //this histo is disabled
1973  0, 0, 0);
1974  if(result==0){
1975  throw cms::Exception("Histo")
1976  << "Failed to book histogram " << name;
1977  }
1978  return result;
1979 }
bool registerHist(const std::string &name, const std::string &title)
tuple result
Definition: query.py:137
DQMStore * dbe_
Histogramming interface.
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1268
MonitorElement * EcalSelectiveReadoutValidation::bookProfile2D ( 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 1981 of file EcalSelectiveReadoutValidation.cc.

References DQMStore::bookProfile2D(), dbe_, edm::hlt::Exception, mergeVDriftHistosByStation::name, registerHist(), and query::result.

Referenced by EcalSelectiveReadoutValidation().

1981  {
1982  if(!registerHist(name, title)) return 0; //this histo is disabled
1984  = dbe_->bookProfile2D(name,
1985  title,
1986  nbinx, xmin, xmax,
1987  nbiny, ymin, ymax,
1988  0, 0, 0,
1989  option);
1990  if(result==0){
1991  throw cms::Exception("Histo")
1992  << "Failed to book histogram " << name;
1993  }
1994  return result;
1995 }
bool registerHist(const std::string &name, const std::string &title)
tuple result
Definition: query.py:137
DQMStore * dbe_
Histogramming interface.
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1412
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 2351 of file EcalSelectiveReadoutValidation.cc.

References dccCh(), fill(), archive::flag, 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().

2352  {
2353  typedef typename T::const_iterator SrFlagCollectionConstIt;
2354  typedef typename T::key_type MyRuDetIdType;
2355 
2356  for(SrFlagCollectionConstIt itSrf = srfs.begin();
2357  itSrf != srfs.end(); ++itSrf){
2358  int flag = itSrf->value() & ~EcalSrFlag::SRF_FORCED_MASK;
2359  pair<int,int> ru = dccCh(itSrf->id());
2360 
2361  if(flag == EcalSrFlag::SRF_FULL){
2362  if(nPerRu_[ru.first-minDccId_][ru.second-1]==getCrystalCount(ru.first, ru.second)){ //no error
2363  fill(meIncompleteFRORateMap_, ruGraphX(itSrf->id()),
2364  ruGraphY(itSrf->id()), 0);
2366  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2367  } else if(nPerRu_[ru.first-minDccId_][ru.second-1]==0) {//tower dropped!
2369  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2371  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2372  fill(meDroppedFROMap_, ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2373  ++nDroppedFRO_;
2374  srApplicationErrorLog_ << event.id() << ": Flag of RU "
2375  << itSrf->id() << " (DCC " << ru.first
2376  << " ch " << ru.second << ") is 'Full readout' "
2377  << "while none of its channel was read out\n";
2378  } else{ //tower partially read out
2380  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2382  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2384  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2385  ++nIncompleteFRO_;
2386  srApplicationErrorLog_ << event.id() << ": Flag of RU"
2387  << itSrf->id() << " (DCC " << ru.first
2388  << " ch " << ru.second << ") is 'Full readout' "
2389  << "while only "
2390  << nPerRu_[ru.first-minDccId_][ru.second-1]
2391  << " / " << getCrystalCount(ru.first, ru.second)
2392  << " channels were read out.\n";
2393  }
2394  }
2395 
2396  if(flag == EcalSrFlag::SRF_ZS1 || flag == EcalSrFlag::SRF_ZS2){
2397  if(nPerRu_[ru.first-minDccId_][ru.second-1]
2398  ==getCrystalCount(ru.first, ru.second)){
2399  //ZS readout unit whose every channel was read
2400 
2401  fill(meCompleteZSMap_, ruGraphX(itSrf->id()), ruGraphY(itSrf->id()));
2403  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2404  //srApplicationErrorLog_ << event.id() << ": "
2405  // << "All " << nMaxXtalPerRu << " channels of RU "
2406  // << itSrf->id() << " passed the Zero suppression.";
2407  ++nCompleteZS_;
2408  } else{
2410  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2411  }
2412  }
2413  }
2414 }
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 275 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh().

275  {
276  return (i<85)?i-85:i-84;
277  }
int i
Definition: DBlmapReader.cc:9
int EcalSelectiveReadoutValidation::cIndex2iPhi ( int  i) const
inlineprivate

converse of iPhi2cIndex() method.

Definition at line 282 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh().

282  {
283  return (i+11) % 360;
284  }
int i
Definition: DBlmapReader.cc:9
int EcalSelectiveReadoutValidation::cIndex2iTtEta ( int  i) const
inlineprivate

converse of iTtEta2cIndex() method.

Definition at line 309 of file EcalSelectiveReadoutValidation.h.

309  {
310  return (i<27)?i-28:i-27;
311  }
int i
Definition: DBlmapReader.cc:9
int EcalSelectiveReadoutValidation::cIndex2iTtPhi ( int  i) const
inlineprivate

converse of iTtPhi2cIndex() method.

Definition at line 315 of file EcalSelectiveReadoutValidation.h.

315  {
316  return i + 1;
317  }
int i
Definition: DBlmapReader.cc:9
int EcalSelectiveReadoutValidation::cIndex2iXY ( int  iX0) const
inlineprivate

converse of iXY2cIndex() method.

Definition at line 269 of file EcalSelectiveReadoutValidation.h.

269  {
270  return iX0+1;
271  }
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 2219 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyze().

2219  {
2220  typedef typename T::const_iterator SrFlagCollectionConstIt;
2221  typedef typename T::key_type MyRuDetIdType;
2222  SrFlagCollectionConstIt itSrfFromData = srfFromData.begin();
2223  SrFlagCollectionConstIt itComputedSr = computedSrf.begin();
2224 
2225  {
2226  PgTiming t("collection comparison");
2227  //cout << __FILE__ << ":" << __LINE__ << ": "
2228  // << srfFromData.size() << " " << computedSrf.size() << "\n";
2229  // int i = 0;
2230  while(itSrfFromData != srfFromData.end()
2231  || itComputedSr != computedSrf.end()){
2232  // cout << ++i << "\n";
2233  MyRuDetIdType inconsistentRu = 0;
2234  bool inconsistent = false;
2235  if(itComputedSr == computedSrf.end() ||
2236  (itSrfFromData != srfFromData.end()
2237  && itSrfFromData->id() < itComputedSr->id())){
2238  //computedSrf is missig a detid found in srfFromData
2239  pair<int, int> ch = dccCh(itSrfFromData->id());
2240  srpAlgoErrorLog_ << event.id() << ": " << itSrfFromData->id()
2241  << ", DCC " << ch.first << " ch " << ch.second
2242  << " found in data (SRF:" << itSrfFromData->flagName()
2243  << ") but not in the set of SRFs computed from the data TTF.\n";
2244  inconsistentRu = itSrfFromData->id();
2245  inconsistent = true;
2246  ++itSrfFromData;
2247  } else if(itSrfFromData==srfFromData.end() ||
2248  (itComputedSr != computedSrf.end()
2249  && itComputedSr->id() < itSrfFromData->id())){
2250  //ebSrFlags is missing a detid found in computedSrf
2251  pair<int, int> ch = dccCh(itComputedSr->id());
2252  if(logErrForDccs_[ch.first-minDccId_]){
2253  srpAlgoErrorLog_ << event.id() << ": " << itComputedSr->id()
2254  << ", DCC " << ch.first << " ch " << ch.second
2255  << " not found in data. Computed SRF: "
2256  << itComputedSr->flagName() << ".\n";
2257  inconsistentRu = itComputedSr->id();
2258  inconsistent = true;
2259  }
2260  ++itComputedSr;
2261  } else{
2262  //*itSrfFromData and *itComputedSr has same detid
2263  if(itComputedSr->value()!=itSrfFromData->value()){
2264  //if(!(itSrfFromData->value & EcalSrFlag::SRF_FORCED_MASK)){
2265  pair<int, int> ch = dccCh(itSrfFromData->id());
2266  srpAlgoErrorLog_ << event.id() << ", "
2267  << itSrfFromData->id()
2268  << ", DCC " << ch.first << " ch " << ch.second
2269  << ", SRF inconsistency: "
2270  << "from data: " << itSrfFromData->flagName()
2271  << ", computed from TTF: "
2272  << itComputedSr->flagName()
2273  << "\n";
2274  //}
2275  inconsistentRu = itComputedSr->id();
2276  inconsistent = true;
2277  }
2278  if(itComputedSr != computedSrf.end()) ++itComputedSr;
2279  if(itSrfFromData != srfFromData.end()) ++itSrfFromData;
2280  }
2281 
2282  if(inconsistent) fill(meSRFlagsConsistency_, ruGraphX(inconsistentRu),
2283  ruGraphY(inconsistentRu));
2284  }
2285  }
2286 }
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 2148 of file EcalSelectiveReadoutValidation.cc.

References edm::hlt::Exception, firstFIRSample_, firWeights_, getFIRWeights(), i, log, indexGen::s2, and mathSSE::sqrt().

Referenced by EcalSelectiveReadoutValidation().

2148  {
2149  bool notNormalized = false;
2150  bool notInt = false;
2151  for(unsigned i=0; i < weightsForZsFIR.size(); ++i){
2152  if(weightsForZsFIR[i] > 1.) notNormalized = true;
2153  if((int)weightsForZsFIR[i]!=weightsForZsFIR[i]) notInt = true;
2154  }
2155  if(notInt && notNormalized){
2156  throw cms::Exception("InvalidParameter")
2157  << "weigtsForZsFIR paramater values are not valid: they "
2158  << "must either be integer and uses the hardware representation "
2159  << "of the weights or less or equal than 1 and used the normalized "
2160  << "representation.";
2161  }
2162  LogInfo log("DccFir");
2163  if(notNormalized){
2164  firWeights_ = vector<int>(weightsForZsFIR.size());
2165  for(unsigned i = 0; i< weightsForZsFIR.size(); ++i){
2166  firWeights_[i] = (int)weightsForZsFIR[i];
2167  }
2168  } else{
2169  firWeights_ = getFIRWeights(weightsForZsFIR);
2170  }
2171 
2172  log << "Input weights for FIR: ";
2173  for(unsigned i = 0; i < weightsForZsFIR.size(); ++i){
2174  log << weightsForZsFIR[i] << "\t";
2175  }
2176 
2177  double s2 = 0.;
2178  log << "\nActual FIR weights: ";
2179  for(unsigned i = 0; i < firWeights_.size(); ++i){
2180  log << firWeights_[i] << "\t";
2181  s2 += firWeights_[i]*firWeights_[i];
2182  }
2183 
2184  s2 = sqrt(s2);
2185  log << "\nNormalized FIR weights after hw representation rounding: ";
2186  for(unsigned i = 0; i < firWeights_.size(); ++i){
2187  log << firWeights_[i] / (double)(1<<10) << "\t";
2188  }
2189 
2190  log <<"\nFirst FIR sample: " << firstFIRSample_;
2191 }
int i
Definition: DBlmapReader.cc:9
static std::vector< std::string > checklist log
tuple s2
Definition: indexGen.py:106
T sqrt(T t)
Definition: SSEVec.h:48
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 1683 of file EcalSelectiveReadoutValidation.cc.

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

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

1683  {
1684  if(detId.det()!=DetId::Ecal){
1685  throw cms::Exception("InvalidParameter")
1686  << "Wrong type of DetId passed to the "
1687  "EcalSelectiveReadoutValidation::dccCh(const DetId&). "
1688  "An ECAL DetId was expected.\n";
1689  }
1690 
1691  DetId xtalId;
1692  switch(detId.subdetId()){
1693  case EcalTriggerTower: //Trigger tower
1694  {
1695  const EcalTrigTowerDetId tt = detId;
1696  //pick up one crystal of the trigger tower: they are however all readout by
1697  //the same DCC channel in the barrel.
1698  //Arithmetic is easier on the "c" indices:
1699  const int iTtPhi0 = iTtPhi2cIndex(tt.iphi());
1700  const int iTtEta0 = iTtEta2cIndex(tt.ieta());
1701  const int oneXtalPhi0 = iTtPhi0 * 5;
1702  const int oneXtalEta0 = (iTtEta0 - nOneEeTtEta) * 5;
1703 
1704  xtalId = EBDetId(cIndex2iEta(oneXtalEta0),
1705  cIndex2iPhi(oneXtalPhi0));
1706  }
1707  break;
1708  case EcalEndcap:
1709  if(detId.rawId() & 0x8000){ //Supercrystal
1710  return elecMap_->getDCCandSC(EcalScDetId(detId));
1711 // throw cms::Exception("InvalidParameter")
1712 // << "Wrong type of DetId passed to the method "
1713 // "EcalSelectiveReadoutValidation::dccCh(const DetId&). "
1714 // "A valid EcalTriggerTower, EcalBarrel or EcalEndcap DetId was expected. "
1715 // "detid = " << xtalId.rawId() << ".\n";
1716  } else { //EE crystal
1717  xtalId = detId;
1718  }
1719  break;
1720  case EcalBarrel: //EB crystal
1721  xtalId = detId;
1722  break;
1723  default:
1724  throw cms::Exception("InvalidParameter")
1725  << "Wrong type of DetId passed to the method "
1726  "EcalSelectiveReadoutValidation::dccCh(const DetId&). "
1727  "A valid EcalTriggerTower, EcalBarrel or EcalEndcap DetId was expected. "
1728  "detid = " << xtalId.rawId() << ".\n";
1729  }
1730 
1731  const EcalElectronicsId& EcalElecId = elecMap_->getElectronicsId(xtalId);
1732 
1733  pair<int,int> result;
1734  result.first = EcalElecId.dccId();
1735 
1736  if(result.first < minDccId_ || result.second > maxDccId_){
1737  throw cms::Exception("OutOfRange")
1738  << "Got an invalid DCC ID, DCCID = " << result.first
1739  << " for DetId 0x" << hex << detId.rawId()
1740  << " and 0x" << xtalId.rawId() << dec << "\n";
1741  }
1742 
1743  result.second = EcalElecId.towerId();
1744 
1745  if(result.second < 1 || result.second > 68){
1746  throw cms::Exception("OutOfRange")
1747  << "Got an invalid DCC channel ID, DCC_CH = " << result.second
1748  << " for DetId 0x" << hex << detId.rawId()
1749  << " and 0x" << xtalId.rawId() << dec << "\n";
1750  }
1751 
1752  return result;
1753 }
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
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.
tuple result
Definition: query.py:137
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 2289 of file EcalSelectiveReadoutValidation.cc.

References elecMap_, and EcalElectronicsMapping::getDCCandSC().

Referenced by selectFedsForLog().

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

Definition at line 2293 of file EcalSelectiveReadoutValidation.cc.

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

2293  {
2294  if(detId.ietaAbs()>17){
2295  throw cms::Exception("InvalidArgument")
2296  << "Argument of EcalSelectiveReadoutValidation::dccId(const EcalTrigTowerDetId&) "
2297  << "must be a barrel trigger tower Id\n";
2298  }
2299  return dccCh(detId).first;
2300 
2301  // int iDccPhi0 = (detId.iphi()-1)/4; //4 TT along phi covered by a DCC
2302  // int iDccEta0 = detId.zside()<0?0:1;
2303  // const int nDccsInPhi = 18;
2304  // return 1 + iDccEta0 * nDccsInPhi + iDccPhi0;
2305 }
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 2084 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().

2087  {
2088  const int nFIRTaps = 6;
2089  //FIR filter weights:
2090  const vector<int>& w = firWeights;
2091 
2092  //accumulator used to compute weighted sum of samples
2093  int acc = 0;
2094  bool gain12saturated = false;
2095  const int gain12 = 0x01;
2096  const int lastFIRSample = firstFIRSample + nFIRTaps - 1;
2097  //LogDebug("DccFir") << "DCC FIR operation: ";
2098  int iWeight = 0;
2099  for(int iSample=firstFIRSample-1;
2100  iSample<lastFIRSample; ++iSample, ++iWeight){
2101  if(iSample>=0 && iSample < frame.size()){
2102  EcalMGPASample sample(frame[iSample]);
2103  if(sample.gainId()!=gain12) gain12saturated = true;
2104  LogTrace("DccFir") << (iSample>=firstFIRSample?"+":"") << sample.adc()
2105  << "*(" << w[iWeight] << ")";
2106  acc+=sample.adc()*w[iWeight];
2107  } else{
2108  edm::LogWarning("DccFir") << __FILE__ << ":" << __LINE__ <<
2109  ": Not enough samples in data frame or 'ecalDccZs1stSample' module "
2110  "parameter is not valid...";
2111  }
2112  }
2113  LogTrace("DccFir") << "\n";
2114  //discards the 8 LSBs
2115  //(shift operator cannot be used on negative numbers because
2116  // the result depends on compilator implementation)
2117  acc = (acc>=0)?(acc >> 8):-(-acc >> 8);
2118  //ZS passed if weighted sum acc above ZS threshold or if
2119  //one sample has a lower gain than gain 12 (that is gain 12 output
2120  //is saturated)
2121 
2122  LogTrace("DccFir") << "acc: " << acc << "\n"
2123  << "saturated: " << (gain12saturated?"yes":"no") << "\n";
2124 
2125  if(saturated){
2126  *saturated = gain12saturated;
2127  }
2128 
2129  return gain12saturated?numeric_limits<int>::max():acc;
2130 }
const double w
Definition: UKUtility.cc:23
int size() const
Definition: EcalDataFrame.h:26
#define LogTrace(id)
void EcalSelectiveReadoutValidation::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Calls at end of run.

Reimplemented from edm::EDAnalyzer.

Definition at line 1392 of file EcalSelectiveReadoutValidation.cc.

References dbe_, MonitorElement::Fill(), getL1aRate(), ievt_, meL1aRate_, normalizeHists(), outputFile_, DQMStore::save(), and useEventRate_.

1392  {
1395  if(outputFile_.size()!=0) dbe_->save(outputFile_);
1396 }
void Fill(long long x)
std::string outputFile_
Output file for histograms.
DQMStore * dbe_
Histogramming interface.
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2540
void EcalSelectiveReadoutValidation::fill ( MonitorElement me,
float  x 
)
inlineprivate

Wrapper to fill methods of DQM monitor elements.

Definition at line 388 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

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

388  {
389  if(me) me->Fill(x);
390  }
void Fill(long long x)
Definition: DDAxes.h:10
void EcalSelectiveReadoutValidation::fill ( MonitorElement me,
float  x,
float  yw 
)
inlineprivate

Definition at line 391 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

391  {
392  if(me) me->Fill(x, yw);
393  }
void Fill(long long x)
Definition: DDAxes.h:10
void EcalSelectiveReadoutValidation::fill ( MonitorElement me,
float  x,
float  y,
float  zw 
)
inlineprivate

Definition at line 394 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

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

Definition at line 397 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

397  {
398  if(me) me->Fill(x, y, z, w);
399  }
const double w
Definition: UKUtility.cc:23
float float float z
void Fill(long long x)
Definition: DDAxes.h:10
double EcalSelectiveReadoutValidation::frame2Energy ( const EcalDataFrame frame) const
private

Energy reconstruction from ADC samples.

Parameters
framethe ADC sample of an ECA channel

Definition at line 1637 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyzeEB(), and analyzeEE().

1637  {
1638  static bool firstCall = true;
1639  if(firstCall){
1640  stringstream buf;
1641  buf << "Weights:";
1642  for(unsigned i=0; i<weights_.size();++i){
1643  buf << "\t" << weights_[i];
1644  }
1645  edm::LogInfo("EcalSrValid") << buf.str() << "\n";
1646  firstCall = false;
1647  }
1648  double adc2GeV = 0.;
1649 
1650  if(typeid(EBDataFrame)==typeid(frame)){//barrel APD
1651  adc2GeV = .035;
1652  } else if(typeid(EEDataFrame)==typeid(frame)){//endcap VPT
1653  adc2GeV = 0.06;
1654  } else{
1655  assert(false);
1656  }
1657 
1658  double acc = 0;
1659 
1660  const int n = min(frame.size(), (int)weights_.size());
1661 
1662  double gainInv[] = {12., 1., 6., 12.};
1663 
1664  for(int i=0; i < n; ++i){
1665  acc += weights_[i]*frame[i].adc()*gainInv[frame[i].gainId()]*adc2GeV;
1666  }
1667  return acc;
1668 }
int i
Definition: DBlmapReader.cc:9
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 1900 of file EcalSelectiveReadoutValidation.cc.

References edm::hlt::Exception, i, n, evf::evtn::offset(), and create_public_pileup_plots::weights.

Referenced by setTtEtSums().

1901  {
1902  //we have to start by 0 in order to handle offset=-1
1903  //(however Fenix FIR has AFAK only 5 taps)
1904  double weights[] = {0., -1/3., -1/3., -1/3., 0., 1.};
1905 
1906  double adc2GeV = 0.;
1907  if(typeid(frame) == typeid(EBDataFrame)){
1908  adc2GeV = 0.035;
1909  } else if(typeid(frame) == typeid(EEDataFrame)){
1910  adc2GeV = 0.060;
1911  } else{ //T is an invalid type!
1912  //TODO: replace message by a cms exception
1913  throw cms::Exception("Severe Error")
1914  << __FILE__ << ":" << __LINE__ << ": "
1915  << "this is a bug. Please report it.\n";
1916  }
1917 
1918  double acc = 0;
1919 
1920  const int n = min<int>(frame.size(), sizeof(weights)/sizeof(weights[0]));
1921 
1922  double gainInv[] = {12., 1., 6., 12};
1923 
1924  for(int i=offset; i < n; ++i){
1925  int iframe = i + offset;
1926  if(iframe>=0 && iframe<frame.size()){
1927  acc += weights[i]*frame[iframe].adc()
1928  *gainInv[frame[iframe].gainId()]*adc2GeV;
1929  //cout << (iframe>offset?"+":"")
1930  // << frame[iframe].adc() << "*" << gainInv[frame[iframe].gainId()]
1931  // << "*" << adc2GeV << "*(" << weights[i] << ")";
1932  }
1933  }
1934  //cout << "\n";
1935  return acc;
1936 }
int i
Definition: DBlmapReader.cc:9
unsigned int offset(bool)
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 169 of file EcalSelectiveReadoutValidation.h.

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

169  {
170  return 3*8;
171  }
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 2416 of file EcalSelectiveReadoutValidation.cc.

References maxDccId_.

Referenced by analyzeDataVolume(), and checkSrApplication().

2416  {
2417  if(iDcc < minDccId_ || iDcc > maxDccId_){ //invalid DCC
2418  return 0;
2419  } else if (10 <= iDcc && iDcc <= 45) {//EB
2420  return 25;
2421  } else { //EE
2422  int iDccPhi;
2423  if(iDcc < 10) iDccPhi = iDcc;
2424  else iDccPhi = iDcc - 45;
2425  switch(iDccPhi*100+iDccCh){
2426  case 110:
2427  case 232:
2428  case 312:
2429  case 412:
2430  case 532:
2431  case 610:
2432  case 830:
2433  case 806:
2434  //inner partials at 12, 3, and 9 o'clock
2435  return 20;
2436  case 134:
2437  case 634:
2438  case 827:
2439  case 803:
2440  return 10;
2441  case 330:
2442  case 430:
2443  return 20;
2444  case 203:
2445  case 503:
2446  case 721:
2447  case 921:
2448  return 21;
2449  default:
2450  return 25;
2451  }
2452  }
2453 }
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 178 of file EcalSelectiveReadoutValidation.h.

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

Referenced by analyzeDataVolume().

178  {
179  subdet_t subdet;
180  if(iDcc0<9 || iDcc0>=45){
181  subdet = EE;
182  } else{
183  subdet = EB;
184  }
185  // return getDccOverhead(subdet)+nReadXtals*getBytesPerCrystal()
186  // + getRuCount(iDcc0)*8;
187  return getDccOverhead(subdet)
188  + getDccSrDependentPayload(iDcc0, getRuCount(iDcc0), nReadXtals);
189  }
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 160 of file EcalSelectiveReadoutValidation.h.

References EB.

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

160  {
161  // return (subdet==EB?34:25)*8;
162  return (subdet==EB?34:52)*8;
163  }
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 198 of file EcalSelectiveReadoutValidation.h.

References getBytesPerCrystal().

Referenced by analyzeDataVolume(), and getDccEventSize().

199  {
200  return nReadXtals*getBytesPerCrystal() + nReadRus*8;
201  }
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 2032 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyzeDataVolume().

2032  {
2033  double ruHeaderPayload = 0.;
2034  const int firstEbDcc0 = nEeDccs/2;
2035  for(int iDcc0 = firstEbDcc0; iDcc0 < firstEbDcc0 + nEbDccs; ++iDcc0){
2036  ruHeaderPayload += getRuCount(iDcc0)*8.;
2037  }
2038 
2039  return getDccOverhead(EB)*nEbDccs + nReadXtals*getBytesPerCrystal()
2040  + ruHeaderPayload;
2041 }
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 2043 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyzeDataVolume().

2043  {
2044  double ruHeaderPayload = 0.;
2045  const unsigned firstEbDcc0 = nEeDccs/2;
2046  for(unsigned iDcc0 = 0; iDcc0 < nDccs_; ++iDcc0){
2047  //skip barrel:
2048  if(iDcc0== firstEbDcc0) iDcc0 += nEbDccs;
2049  ruHeaderPayload += getRuCount(iDcc0)*8.;
2050  }
2051  return getDccOverhead(EE)*nEeDccs + nReadXtals*getBytesPerCrystal()
2052  + ruHeaderPayload;
2053 }
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 2133 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by configFirWeights().

2134  {
2135  const int nFIRTaps = 6;
2136  vector<int> firWeights(nFIRTaps, 0); //default weight: 0;
2137  const static int maxWeight = 0xEFF; //weights coded on 11+1 signed bits
2138  for(unsigned i=0; i < min((size_t)nFIRTaps,normalizedWeights.size()); ++i){
2139  firWeights[i] = lround(normalizedWeights[i] * (1<<10));
2140  if(abs(firWeights[i])>maxWeight){//overflow
2141  firWeights[i] = firWeights[i]<0?-maxWeight:maxWeight;
2142  }
2143  }
2144  return firWeights;
2145 }
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 719 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by endRun().

719  {
720  LogDebug("EcalSrValid") << __FILE__ << ":" << __LINE__ << ": "
721  << "Tmax = " << tmax << " x 25ns; Tmin = " << tmin
722  << " x 25ns; L1A(Tmax) = " << l1aOfTmax << "; L1A(Tmin) = "
723  << l1aOfTmin << "\n";
724  return (double)(l1aOfTmax - l1aOfTmin) / ((tmax-tmin) * 25e-9);
725 }
#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 1670 of file EcalSelectiveReadoutValidation.cc.

References nRuPerDcc_.

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

1670  {
1671  // static int nEemRu[] = {34, 32, 33, 33, 32, 34, 33, 34, 33};
1672  // static int nEepRu[] = {32, 33, 33, 32, 34, 33, 34, 33, 34};
1673  // if(iDcc0<9){//EE-
1674  // return nEemRu[iDcc0];
1675  // } else if(iDcc0>=45){//EE+
1676  // return nEepRu[iDcc0-45];
1677  // } else{//EB
1678  // return 68;
1679  // }
1680  return nRuPerDcc_[iDcc0];
1681 }
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 246 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and analyzeEB().

246  {
247  return (iEta<0)?iEta+85:iEta+84;
248  }
void EcalSelectiveReadoutValidation::initAsciiFile ( )
private

Definition at line 2193 of file EcalSelectiveReadoutValidation.cc.

References edm::hlt::Exception, logSrApplicationErrors_, logSrpAlgoErrors_, dbtoconf::out, srApplicationErrorLog_, srApplicationErrorLogFileName_, srpAlgoErrorLog_, srpAlgoErrorLogFileName_, and estimatePileup_makeJSON::trunc.

Referenced by beginRun().

2193  {
2194  if(logSrpAlgoErrors_){
2196  if(!srpAlgoErrorLog_.good()){
2197  throw cms::Exception("Output")
2198  << "Failed to open the log file '"
2200  << "' for SRP algorithm result check.\n";
2201  }
2202  }
2203 
2206  if(!srApplicationErrorLog_.good()){
2207  throw cms::Exception("Output")
2208  << "Failed to open the log file '"
2210  << "' for Selective Readout decision application check.\n";
2211  }
2212  }
2213 }
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
tuple out
Definition: dbtoconf.py:99
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 253 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and analyzeEB().

253  {
254  // return iPhi-1;
255  int iPhi0 = iPhi - 11;
256  if(iPhi0<0) iPhi0 += 360;
257  return iPhi0;
258  }
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 291 of file EcalSelectiveReadoutValidation.h.

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

291  {
292  return (iEta<0)?iEta+28:iEta+27;
293  }
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 300 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh(), and setTtEtSums().

300  {
301  return iPhi-1;
302  //int iPhi0 = iPhi - 3;
303  //if(iPhi0<0) iPhi0 += 72;
304  //return iPhi0;
305  }
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 263 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and analyzeEE().

263  {
264  return iX-1;
265  }
void EcalSelectiveReadoutValidation::myAna ( )
private
void EcalSelectiveReadoutValidation::normalizeHists ( double  eventCount)
private

Scaled histograms expressed in rate by 1/eventCount

Parameters
eventCountevent count to use for normalization factor

Definition at line 2055 of file EcalSelectiveReadoutValidation.cc.

References MonitorElement::getTH1(), h, i, meChOcc_, meForcedRu_, meFullRoRu_, meHiTtf_, meLiTtf_, meMiTtf_, meTp_, meTtf_, meZs1Ru_, and pileupReCalc_HLTpaths::scale.

Referenced by endRun().

2055  {
2058  //meEbLiZsFir_, meEbHiZsFir_,
2059  //meEeLiZsFir_, meEeHiZsFir_,
2060  };
2061 
2062  double scale = 1./eventCount;
2063  stringstream buf;
2064  for(unsigned i = 0; i < sizeof(mes)/sizeof(mes[0]); ++i){
2065  if(mes[i] == 0) continue;
2066  TH1* h = mes[i]->getTH1();
2067  if(dynamic_cast<TH2*>(h)){//TH2
2068  h->GetZaxis()->SetTitle("Frequency");
2069  } else{ //assuming TH1
2070  h->GetYaxis()->SetTitle("<Count>");
2071  }
2072  buf << "Normalising " << h->GetName() << ". Factor: " << scale << "\n";
2073  h->Scale(scale);
2074  //Set average bit so histogram can be added correctly. Beware must be done
2075  //after call the TH1::Scale (Scale has no effect if average bit is set)
2076  h->SetBit(TH1::kIsAverage);
2077  }
2078  edm::LogInfo("EcalSrValid") << buf.str();
2079 }
int i
Definition: DBlmapReader.cc:9
TH1 * getTH1(void) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void EcalSelectiveReadoutValidation::printAvailableHists ( )
private

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

Definition at line 2020 of file EcalSelectiveReadoutValidation.cc.

References availableHistList_, and log.

Referenced by EcalSelectiveReadoutValidation().

2020  {
2021  LogInfo log("HistoList");
2022  log << "Avalailable histograms (DQM monitor elements): \n";
2023  for(map<string, string>::iterator it = availableHistList_.begin();
2024  it != availableHistList_.end();
2025  ++it){
2026  log << it->first << ": " << it->second << "\n";
2027  }
2028  log << "\nTo include an histogram add its name in the vstring parameter "
2029  "'histograms' of the EcalSelectiveReadoutValidation module\n";
2030 }
static std::vector< std::string > checklist log
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 2003 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().

2003  {
2004  ebRecHits_.read(event);
2005  eeRecHits_.read(event);
2006  ebDigis_.read(event);
2007  eeDigis_.read(event);
2010  ebSrFlags_.read(event);
2011  eeSrFlags_.read(event);
2012  ebComputedSrFlags_.read(event);
2013  eeComputedSrFlags_.read(event);
2016  tps_.read(event);
2017  fedRaw_.read(event);
2018 }
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 1795 of file EcalSelectiveReadoutValidation.cc.

References EcalTrigTowerConstituentsMap::towerOf(), and triggerTowerMap_.

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

1795  {
1796  return triggerTowerMap_->towerOf(xtalId);
1797 }
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 1800 of file EcalSelectiveReadoutValidation.cc.

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

1800  {
1801  // return superCrystalOf(xtalId);
1802  const EcalElectronicsId& EcalElecId = elecMap_->getElectronicsId(xtalId);
1803  int iDCC= EcalElecId.dccId();
1804  int iDccChan = EcalElecId.towerId();
1805  const bool ignoreSingle = true;
1806  const vector<EcalScDetId> id = elecMap_->getEcalScDetId(iDCC, iDccChan, ignoreSingle);
1807  return id.size()>0?id[0]:EcalScDetId();
1808 }
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 1997 of file EcalSelectiveReadoutValidation.cc.

References allHists_, availableHistList_, and histList_.

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

1998  {
1999  availableHistList_.insert(pair<string, string>(name, title));
2000  return allHists_ || histList_.find(name)!=histList_.end();
2001 }
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 926 of file EcalSelectiveReadoutValidation.h.

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

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

Definition at line 934 of file EcalSelectiveReadoutValidation.h.

934  {
935  return id.ieta();
936  }
int EcalSelectiveReadoutValidation::ruGraphY ( const EcalScDetId id) const
inlineprivate

Definition at line 930 of file EcalSelectiveReadoutValidation.h.

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

930  {
931  return id.iy();
932  }
int EcalSelectiveReadoutValidation::ruGraphY ( const EcalTrigTowerDetId id) const
inlineprivate

Definition at line 938 of file EcalSelectiveReadoutValidation.h.

938  {
939  return id.iphi();
940  }
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 2309 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyze().

2309  {
2310  logErrForDccs_ = vector<bool>(nDccs_, false);
2311 
2313  it != ebSrFlags_->end();
2314  ++it){
2315 
2316  //cout << __FILE__ << ":" << __LINE__ << ": "
2317  // << EcalTrigTowerDetId(it->id()) << "\n";
2318 
2319  int iDcc = dccId(it->id()) - minDccId_;
2320  // cout << __FILE__ << ":" << __LINE__ << ": "
2321  // << it->id().rawId() << "-> DCC " << (iDcc+1) << "\n";
2322  logErrForDccs_.at(iDcc) = true;
2323  }
2324 
2326  it != eeSrFlags_->end();
2327  ++it){
2328  int iDcc = dccId(it->id()) - minDccId_;
2329 // cout << __FILE__ << ":" << __LINE__ << ": "
2330 // << it->id().rawId() << "-> DCC " << (iDcc+1) << "\n";
2331  logErrForDccs_.at(iDcc) = true;
2332  }
2333 
2334  stringstream buf;
2335  buf << "List of DCCs found in the first processed event: ";
2336  bool first = true;
2337  for(unsigned iDcc = 0; iDcc < nDccs_; ++iDcc){
2338  if(logErrForDccs_[iDcc]){
2339  buf << (first?"":", ") << (iDcc + minDccId_);
2340  first = false;
2341  }
2342  }
2343  buf << "\nOnly DCCs from this list will be considered for error logging\n";
2344  srpAlgoErrorLog_ << buf.str();
2345  srApplicationErrorLog_<< buf.str();
2346  LogInfo("EcalSrValid") << buf;
2347 }
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
std::vector< EBSrFlag >::const_iterator const_iterator
CollHandle< EBSrFlagCollection > ebSrFlags_
bool first
Definition: L1TdeRCT.cc:75
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 1811 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().

1813  {
1814  //ecal geometry:
1815  static const CaloSubdetectorGeometry* eeGeometry = 0;
1816  static const CaloSubdetectorGeometry* ebGeometry = 0;
1817  if(eeGeometry==0 || ebGeometry==0){
1818  edm::ESHandle<CaloGeometry> geoHandle;
1819  es.get<MyCaloGeometryRecord>().get(geoHandle);
1820  eeGeometry
1821  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
1822  ebGeometry
1823  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
1824  }
1825 
1826  //init etSum array:
1827  for(int iEta0 = 0; iEta0 < nTtEta; ++iEta0){
1828  for(int iPhi0 = 0; iPhi0 < nTtPhi; ++iPhi0){
1829  ttEtSums[iEta0][iPhi0] = 0.;
1830  }
1831  }
1832 
1834  it != ebDigis_->end(); ++it){
1835  const EBDataFrame& frame = *it;
1836  const EcalTrigTowerDetId& ttId = triggerTowerMap_->towerOf(frame.id());
1837  // LogDebug("TT")
1838  // << ((EBDetId&)frame.id()).ieta()
1839  // << "," << ((EBDetId&)frame.id()).iphi()
1840  // << " -> " << ttId.ieta() << "," << ttId.iphi();
1841  const int iTtEta0 = iTtEta2cIndex(ttId.ieta());
1842  const int iTtPhi0 = iTtPhi2cIndex(ttId.iphi());
1843  double theta = ebGeometry->getGeometry(frame.id())->getPosition().theta();
1844  double e = frame2EnergyForTp(frame);
1845  if((frame2EnergyForTp(frame,-1) < e) && (frame2EnergyForTp(frame, 1) < e)){
1846  ttEtSums[iTtEta0][iTtPhi0] += e*sin(theta);
1847  }
1848  }
1849 
1850  for(EEDigiCollection::const_iterator it = eeDigis.begin();
1851  it != eeDigis.end(); ++it){
1852  const EEDataFrame& frame = *it;
1853  const EcalTrigTowerDetId& ttId = triggerTowerMap_->towerOf(frame.id());
1854  const int iTtEta0 = iTtEta2cIndex(ttId.ieta());
1855  const int iTtPhi0 = iTtPhi2cIndex(ttId.iphi());
1856  // LogDebug("TT") << ": EE xtal->TT "
1857  // << ((EEDetId&)frame.id()).ix()
1858  // << "," << ((EEDetId&)frame.id()).iy()
1859  // << " -> " << ttId.ieta() << "," << ttId.iphi() << "\n";
1860  double theta = eeGeometry->getGeometry(frame.id())->getPosition().theta();
1861  double e = frame2EnergyForTp(frame);
1862  if((frame2EnergyForTp(frame,-1) < e) && (frame2EnergyForTp(frame, 1) < e)){
1863  ttEtSums[iTtEta0][iTtPhi0] += e*sin(theta);
1864  }
1865  }
1866 
1867  //dealing with pseudo-TT in two inner EE eta-ring:
1868  int innerTTEtas[] = {0, 1, 54, 55};
1869  for(unsigned iRing = 0; iRing < sizeof(innerTTEtas)/sizeof(innerTTEtas[0]);
1870  ++iRing){
1871  int iTtEta0 = innerTTEtas[iRing];
1872  //this detector eta-section is divided in only 36 phi bins
1873  //For this eta regions,
1874  //current tower eta numbering scheme is inconsistent. For geometry
1875  //version 133:
1876  //- TT are numbered from 0 to 72 for 36 bins
1877  //- some TT have an even index, some an odd index
1878  //For geometry version 125, there are 72 phi bins.
1879  //The code below should handle both geometry definition.
1880  //If there are 72 input trigger primitives for each inner eta-ring,
1881  //then the average of the trigger primitive of the two pseudo-TT of
1882  //a pair (nEta, nEta+1) is taken as Et of both pseudo TTs.
1883  //If there are only 36 input TTs for each inner eta ring, then half
1884  //of the present primitive of a pseudo TT pair is used as Et of both
1885  //pseudo TTs.
1886 
1887  for(unsigned iTtPhi0 = 0; iTtPhi0 < nTtPhi-1; iTtPhi0 += 2){
1888  double et = .5*(ttEtSums[iTtEta0][iTtPhi0]
1889  +ttEtSums[iTtEta0][iTtPhi0+1]);
1890  //divides the TT into 2 phi bins in order to match with 72 phi-bins SRP
1891  //scheme or average the Et on the two pseudo TTs if the TT is already
1892  //divided into two trigger primitives.
1893  ttEtSums[iTtEta0][iTtPhi0] = et;
1894  ttEtSums[iTtEta0][iTtPhi0+1] = et;
1895  }
1896  }
1897 }
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:55
const_iterator end() const
static const int nTtEta
Number of Trigger Towers along Eta.
CollHandle< EBDigiCollection > ebDigis_
const EcalTrigTowerConstituentsMap * triggerTowerMap_
void EcalSelectiveReadoutValidation::SRFlagValidation ( const edm::Event event,
const edm::EventSetup es 
)
private

Selective Readout decisions Validation

Parameters
eventEDM event
esevent setupSelective Readout decisions Validation
eventEDM event
esevent setup
EcalScDetId EcalSelectiveReadoutValidation::superCrystalOf ( const EEDetId xtalId) const
private

Retrieves the endcap supercrystal containing a given crysal

Parameters
xtalIdidentifier of the crystal
Returns
the identifier of the supercrystal

Definition at line 1756 of file EcalSelectiveReadoutValidation.cc.

References EEDetId::ix(), EEDetId::iy(), scEdge, and EEDetId::zside().

1757 {
1758 
1759  const int scEdge = 5;
1760  EcalScDetId id = EcalScDetId((xtalId.ix()-1)/scEdge+1,
1761  (xtalId.iy()-1)/scEdge+1,
1762  xtalId.zside());
1763  return id;
1764  /*
1765  const EcalElectronicsId& EcalElecId = elecMap_->getElectronicsId(xtalId);
1766  int iDCC= EcalElecId.dccId();
1767  int iDccChan = EcalElecId.towerId();
1768  const vector<EcalScDetId> id = elecMap_->getEcalScDetId(iDCC, iDccChan);
1769 
1770  if(SkipInnerSC_)
1771  {
1772  if( (id.ix()>=9 && id.ix()<=12) && (id.iy()>=9 && id.iy()<=12) )
1773  return EcalScDetId();
1774  else
1775  return id;
1776  }
1777  else
1778  {
1779  if(id.ix()==9 && id.iy()==9)
1780  return EcalScDetId(2,5,xtalId.zside());
1781  else if(id.ix()==9 && id.iy()==12)
1782  return EcalScDetId(1,13,xtalId.zside());
1783  else if(id.ix()==12 && id.iy()==9)
1784  return EcalScDetId(19,5,xtalId.zside());
1785  else if(id.ix()==12 && id.iy()==12)
1786  return EcalScDetId(20,13,xtalId.zside());
1787  else
1788  return id;
1789  }
1790  */
1791 }
int ix() const
Definition: EEDetId.h:76
int zside() const
Definition: EEDetId.h:70
int iy() const
Definition: EEDetId.h:82
static const int scEdge
Number of crystals along a supercrystal edge.
void EcalSelectiveReadoutValidation::updateL1aRate ( const edm::Event event)
private

Updates estimate of L1A rate

Parameters
eventEDM event

Definition at line 701 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyze().

701  {
702  const int32_t bx = event.bunchCrossing();
703  if(bx<1 || bx > 3564) return;//throw cms::Exception("EcalSelectiveReadoutValidation")
704  // << "bx value, " << bx << " is out of range\n";
705 
706  int64_t t = event.bunchCrossing() + (event.orbitNumber()-1)*3564;
707 
708  if(t<tmin){
709  tmin = t;
710  l1aOfTmin = event.id().event();
711  }
712 
713  if(t>tmax){
714  tmax = t;
715  l1aOfTmax = event.id().event();
716  }
717 }
int EcalSelectiveReadoutValidation::xtalGraphX ( const EEDetId id) const
inlineprivate

Definition at line 942 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and analyzeEE().

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

Definition at line 950 of file EcalSelectiveReadoutValidation.h.

950  {
951  return id.ieta();
952  }
int EcalSelectiveReadoutValidation::xtalGraphY ( const EEDetId id) const
inlineprivate

Definition at line 946 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and analyzeEE().

946  {
947  return id.iy();
948  }
int EcalSelectiveReadoutValidation::xtalGraphY ( const EBDetId id) const
inlineprivate

Definition at line 954 of file EcalSelectiveReadoutValidation.h.

954  {
955  return id.iphi();
956  }

Member Data Documentation

bool EcalSelectiveReadoutValidation::allHists_
private

When true, every histogram is enabled.

Definition at line 849 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 858 of file EcalSelectiveReadoutValidation.h.

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

bool EcalSelectiveReadoutValidation::collNotFoundWarn_
private

Switch for collection-not-found warning.

Definition at line 521 of file EcalSelectiveReadoutValidation.h.

DQMStore* EcalSelectiveReadoutValidation::dbe_
private

Histogramming interface.

Definition at line 515 of file EcalSelectiveReadoutValidation.h.

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

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

The event product collections.

Definition at line 543 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 830 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation::Sorter::operator()().

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 807 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 489 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi().

int EcalSelectiveReadoutValidation::ebZsThr_
private

ZS threshold in 1/4th ADC count for EB

Definition at line 728 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), 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 836 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 808 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 732 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

const EcalElectronicsMapping* EcalSelectiveReadoutValidation::elecMap_
private

Ecal electronics/geometrical mapping.

Definition at line 711 of file EcalSelectiveReadoutValidation.h.

Referenced by beginRun(), dccCh(), dccId(), 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 741 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 724 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 853 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

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

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

Definition at line 845 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and registerHist().

int EcalSelectiveReadoutValidation::ievt_
private

Event sequence number

Definition at line 819 of file EcalSelectiveReadoutValidation.h.

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

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

Definition at line 811 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 443 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume().

int64_t EcalSelectiveReadoutValidation::l1aOfTmax
private

Definition at line 565 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

int64_t EcalSelectiveReadoutValidation::l1aOfTmin
private

Definition at line 564 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

bool EcalSelectiveReadoutValidation::l1aRateErr
private

Definition at line 566 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 716 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 752 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 901 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 896 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and initAsciiFile().

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

Definition at line 456 of file EcalSelectiveReadoutValidation.h.

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

MonitorElement* EcalSelectiveReadoutValidation::meChOcc_
private
MonitorElement* EcalSelectiveReadoutValidation::meCompleteZS_
private

Definition at line 636 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meCompleteZSCnt_
private

Definition at line 648 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meCompleteZSMap_
private
MonitorElement* EcalSelectiveReadoutValidation::meCompleteZSRateMap_
private
MonitorElement* EcalSelectiveReadoutValidation::meDccHiVol_
private
MonitorElement* EcalSelectiveReadoutValidation::meDccLiVol_
private
MonitorElement* EcalSelectiveReadoutValidation::meDccVol_
private

The histograms

Definition at line 572 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meDccVolFromData_
private
MonitorElement* EcalSelectiveReadoutValidation::meDroppedFRO_
private

Definition at line 635 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meDroppedFROCnt_
private

Definition at line 647 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meDroppedFROMap_
private
MonitorElement* EcalSelectiveReadoutValidation::meDroppedFRORateMap_
private
MonitorElement* EcalSelectiveReadoutValidation::meEbEMean_
private

Definition at line 594 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbFixedPayload_
private

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

Definition at line 661 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbFullRoCnt_
private

Definition at line 621 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbHiZsFir_
private

Definition at line 625 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbIncompleteRUZsFir_
private

Definition at line 626 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meEbLiZsFir_
private

Definition at line 624 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbNoise_
private

Definition at line 595 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbNoZsRecVsSimE_
private

Definition at line 599 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbRecE_
private

Definition at line 593 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbRecEHitXtal_
private

Definition at line 597 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbRecVsSimE_
private

Definition at line 598 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbSimE_
private

Definition at line 596 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbZsErrCnt_
private

Definition at line 649 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbZsErrType1Cnt_
private

Definition at line 652 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeEMean_
private

Definition at line 602 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeFixedPayload_
private

Definition at line 662 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeFullRoCnt_
private

Definition at line 622 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeHiZsFir_
private

Definition at line 629 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeLiZsFir_
private

Definition at line 628 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeNoise_
private

Definition at line 603 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeNoZsRecVsSimE_
private

Definition at line 607 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeRecE_
private

Definition at line 601 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeRecEHitXtal_
private

Definition at line 605 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeRecVsSimE_
private

Definition at line 606 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeSimE_
private

Definition at line 604 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeZsErrCnt_
private

Definition at line 650 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeZsErrType1Cnt_
private

Definition at line 653 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meFixedPayload_
private

Definition at line 663 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meForcedRu_
private
MonitorElement* EcalSelectiveReadoutValidation::meForcedTtf_
private

Definition at line 616 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meFullRoCnt_
private

Definition at line 620 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meFullRoRu_
private
MonitorElement* EcalSelectiveReadoutValidation::meHiTtf_
private
MonitorElement* EcalSelectiveReadoutValidation::meIncompleteFRO_
private

Definition at line 634 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meIncompleteFROCnt_
private

Definition at line 646 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meIncompleteFROMap_
private
MonitorElement* EcalSelectiveReadoutValidation::meIncompleteFRORateMap_
private
MonitorElement* EcalSelectiveReadoutValidation::meL1aRate_
private

Estimate of L1A rate

Definition at line 668 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and endRun().

MonitorElement* EcalSelectiveReadoutValidation::meLiTtf_
private
MonitorElement* EcalSelectiveReadoutValidation::meMiTtf_
private
MonitorElement* EcalSelectiveReadoutValidation::meSRFlagsComputed_
private

Definition at line 631 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meSRFlagsConsistency_
private
MonitorElement* EcalSelectiveReadoutValidation::meSRFlagsFromData_
private

Definition at line 630 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meTp_
private
MonitorElement* EcalSelectiveReadoutValidation::meTpMap_
private

Definition at line 618 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meTpVsEtSum_
private

Definition at line 591 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meTtf_
private
MonitorElement* EcalSelectiveReadoutValidation::meTtfVsEtSum_
private

Definition at line 590 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meTtfVsTp_
private

Definition at line 589 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meVol_
private
MonitorElement* EcalSelectiveReadoutValidation::meVolB_
private
MonitorElement* EcalSelectiveReadoutValidation::meVolBHI_
private
MonitorElement* EcalSelectiveReadoutValidation::meVolBLI_
private
MonitorElement* EcalSelectiveReadoutValidation::meVolE_
private
MonitorElement* EcalSelectiveReadoutValidation::meVolEHI_
private
MonitorElement* EcalSelectiveReadoutValidation::meVolELI_
private
MonitorElement* EcalSelectiveReadoutValidation::meVolHI_
private
MonitorElement* EcalSelectiveReadoutValidation::meVolLI_
private
MonitorElement* EcalSelectiveReadoutValidation::meZs1Ru_
private
MonitorElement* EcalSelectiveReadoutValidation::meZsErrCnt_
private

Definition at line 651 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meZsErrType1Cnt_
private

Definition at line 654 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

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

Counter of ZS-flagged RU fully read out.

Definition at line 677 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 450 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 471 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume().

const unsigned EcalSelectiveReadoutValidation::nDccs_ = 54
staticprivate
int EcalSelectiveReadoutValidation::nDroppedFRO_
private

Counter of FRO-flagged RU dropped from data.

Definition at line 671 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and checkSrApplication().

int EcalSelectiveReadoutValidation::nEb_
private

ECAL barrel read channel count

Definition at line 756 of file EcalSelectiveReadoutValidation.h.

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

const int EcalSelectiveReadoutValidation::nEbDccs = 36
staticprivate

number of DCCs for EB

Definition at line 459 of file EcalSelectiveReadoutValidation.h.

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

const int EcalSelectiveReadoutValidation::nEbEta = 170
staticprivate

number of crystals along Eta in EB

Definition at line 477 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB().

int EcalSelectiveReadoutValidation::nEbFROCnt_
private

Counter of EB FRO-flagged RUs.

Definition at line 680 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEB().

int EcalSelectiveReadoutValidation::nEbHI_
private

ECAL barrel high interest read channel count

Definition at line 776 of file EcalSelectiveReadoutValidation.h.

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

int EcalSelectiveReadoutValidation::nEbLI_
private

ECAL barrel low interest read channel count

Definition at line 772 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 480 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB().

const int EcalSelectiveReadoutValidation::nEbRus = 36*68
staticprivate

number of RUs for EB

Definition at line 465 of file EcalSelectiveReadoutValidation.h.

const int EcalSelectiveReadoutValidation::nEbTtEta = 34
staticprivate

Number of Trigger Towers in barrel along Eta.

Definition at line 498 of file EcalSelectiveReadoutValidation.h.

int EcalSelectiveReadoutValidation::nEbZsErrors_
private

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

Definition at line 686 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 693 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEB().

int EcalSelectiveReadoutValidation::nEe_
private

ECAL endcap read channel count

Definition at line 760 of file EcalSelectiveReadoutValidation.h.

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

const int EcalSelectiveReadoutValidation::nEeDccs = 18
staticprivate

number of DCCs for EE

Definition at line 462 of file EcalSelectiveReadoutValidation.h.

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

int EcalSelectiveReadoutValidation::nEeFROCnt_
private

Counter of EE FRO-flagged RUs.

Definition at line 683 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEE().

int EcalSelectiveReadoutValidation::nEeHI_
private

ECAL endcap high interest read channel count

Definition at line 768 of file EcalSelectiveReadoutValidation.h.

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

int EcalSelectiveReadoutValidation::nEeLI_
private

ECAL endcap low interest read channel count

Definition at line 764 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 468 of file EcalSelectiveReadoutValidation.h.

const int EcalSelectiveReadoutValidation::nEeX = 100
staticprivate

EE crystal grid size along X.

Definition at line 483 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE().

const int EcalSelectiveReadoutValidation::nEeY = 100
staticprivate

EE crystal grid size along Y.

Definition at line 486 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE().

int EcalSelectiveReadoutValidation::nEeZsErrors_
private

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

Definition at line 689 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 697 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEE().

const int EcalSelectiveReadoutValidation::nEndcaps = 2
staticprivate

number of endcaps

Definition at line 474 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 788 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 801 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 674 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 784 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 797 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 507 of file EcalSelectiveReadoutValidation.h.

const int EcalSelectiveReadoutValidation::nOneEeTtEta = 11
staticprivate

Number of Trigger Towers in an endcap along Eta.

Definition at line 495 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh().

int EcalSelectiveReadoutValidation::nPerDcc_[nDccs_]
private

read-out ECAL channel count for each DCC:

Definition at line 780 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 815 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 793 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 501 of file EcalSelectiveReadoutValidation.h.

Referenced by setTtEtSums().

const int EcalSelectiveReadoutValidation::nTtPhi = 72
staticprivate

Number of Trigger Towers along Phi.

Definition at line 504 of file EcalSelectiveReadoutValidation.h.

Referenced by setTtEtSums().

std::string EcalSelectiveReadoutValidation::outputFile_
private

Output file for histograms.

Definition at line 518 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and endRun().

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

Conversion factor from radian to degree.

Definition at line 509 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 492 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and superCrystalOf().

bool EcalSelectiveReadoutValidation::SkipInnerSC_
private

Permits to skip inner SC

Definition at line 840 of file EcalSelectiveReadoutValidation.h.

std::ofstream EcalSelectiveReadoutValidation::srApplicationErrorLog_
private

Output ascii file for unconsistency between Xtals and RU Flags.

Definition at line 535 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 529 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 532 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 525 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and initAsciiFile().

int64_t EcalSelectiveReadoutValidation::tmax
private

For L1A rate estimate

Definition at line 562 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

int64_t EcalSelectiveReadoutValidation::tmin
private

Definition at line 563 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

bool EcalSelectiveReadoutValidation::tpInGeV_
private

Switch for uncompressing TP value

Definition at line 736 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

const EcalTPParameters* EcalSelectiveReadoutValidation::tpParam_
private

Interface to access trigger primitive parameters, especially to convert Et in compressed formart into natural unit.

Definition at line 707 of file EcalSelectiveReadoutValidation.h.

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

ECAL trigger tower mapping

Definition at line 702 of file EcalSelectiveReadoutValidation.h.

Referenced by beginRun(), 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 825 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 746 of file EcalSelectiveReadoutValidation.h.

Referenced by endRun().

bool EcalSelectiveReadoutValidation::verbose_
private

Verbosity switch.

Definition at line 512 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

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

Weights for amplitude local reconstruction

Definition at line 720 of file EcalSelectiveReadoutValidation.h.

Referenced by frame2Energy().

bool EcalSelectiveReadoutValidation::withEbSimHit_
private

Indicates if EB sim hits are available

Definition at line 867 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEB().

bool EcalSelectiveReadoutValidation::withEeSimHit_
private

Indicates if EE sim hits are available

Definition at line 863 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEE().

std::ofstream EcalSelectiveReadoutValidation::zsErrorLog_
private

File to log ZS and other errors.

Definition at line 538 of file EcalSelectiveReadoutValidation.h.