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

References allHists_, availableHistList_, book1D(), book2D(), bookFloat(), bookProfile(), bookProfile2D(), configFirWeights(), dbe_, EB, ebZsThr_, EE, eeZsThr_, 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, srApplicationErrorLogFileName_, srpAlgoErrorLogFileName_, AlCaHLTBitMon_QueryRunRegistry::string, lumiQTWidget::t, indexGen::title, tpInGeV_, and verbose_.

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

1358  {
1359 }

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

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

Referenced by analyzeDataVolume().

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

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

Referenced by analyzeDataVolume().

1602  {
1603  nEb_ = 0;
1604  nEe_ = 0;
1605  nEeLI_ = 0;
1606  nEeHI_ = 0;
1607  nEbLI_ = 0;
1608  nEbHI_ = 0;
1609  bzero(nPerDcc_, sizeof(nPerDcc_));
1610  bzero(nLiPerDcc_, sizeof(nLiPerDcc_));
1611  bzero(nHiPerDcc_, sizeof(nHiPerDcc_));
1612  bzero(nRuPerDcc_, sizeof(nRuPerDcc_));
1613  bzero(ebRuActive_, sizeof(ebRuActive_));
1614  bzero(eeRuActive_, sizeof(eeRuActive_));
1615  bzero(nPerRu_, sizeof(nPerRu_));
1616  bzero(nLiRuPerDcc_, sizeof(nLiRuPerDcc_));
1617  bzero(nHiRuPerDcc_, sizeof(nHiRuPerDcc_));
1618 }
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 710 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(), lumiQTWidget::t, tps_, updateL1aRate(), withEbSimHit_, and withEeSimHit_.

711  {
712 
714 
715  {
716  PgTiming t("collection readout");
717 
718  //retrieves event products:
720 
721  }
722 
723  withEeSimHit_ = (eeSimHits_->size()!=0);
724  withEbSimHit_ = (ebSimHits_->size()!=0);
725 
726  if(ievt_<10){
727  edm::LogInfo("EcalSrValid") << "Size of TP collection: " << tps_->size() << "\n"
728  << "Size of EB SRF collection read from data: "
729  << ebSrFlags_->size() << "\n"
730  << "Size of EB SRF collection computed from data TTFs: "
731  << ebComputedSrFlags_->size() << "\n"
732  << "Size of EE SRF collection read from data: "
733  << eeSrFlags_->size() << "\n"
734  << "Size of EE SRF collection computed from data TTFs: "
735  << eeComputedSrFlags_->size() << "\n";
736  }
737 
738  if(ievt_==0){
739  selectFedsForLog(); //note: must be called after readAllCollection
740  }
741 
742  //computes Et sum trigger tower crystals:
744 
745  {
746  PgTiming t("data volume analysis");
747 
748  //Data Volume
750  }
751 
752  {
753  PgTiming t("EB analysis");
754  //EB digis
755  //must be called after analyzeDataVolume because it uses
756  //isRuComplete_ array that this method fills
757  analyzeEB(event, es);
758  }
759 
760  {
761  PgTiming t("EE analysis");
762  //EE digis
763  //must be called after analyzeDataVolume because it uses
764  //isRuComplete_ array that this method fills
765  analyzeEE(event, es);
766  }
767 
771 
775 
779 
780  {
781  PgTiming t("TP analysis");
782  //TP
783  analyzeTP(event, es);
784  }
785 
786  //SR Consistency and validation
787  //SRFlagValidation(event,es);
788  if(ebComputedSrFlags_->size()){
790  }
791  if(eeComputedSrFlags_->size()){
793  }
794  nDroppedFRO_ = 0;
795  nIncompleteFRO_ = 0;
796  nCompleteZS_ = 0;
802  ++ievt_;
803 }
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 1443 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().

1444  {
1445 
1446  anaDigiInit();
1447 
1448 
1449  //Complete RU, i.e. RU actually fully readout
1450  for(int iDcc = minDccId_; iDcc <= maxDccId_; ++iDcc){
1451  for(int iCh = 1; iCh < nDccRus_[iDcc-minDccId_]; ++iCh){
1452  isRuComplete_[iDcc-minDccId_][iCh-1]
1453  = (nPerRu_[iDcc-minDccId_][iCh-1]==getCrystalCount(iDcc, iCh));
1454  }
1455  }
1456 
1457 
1458  //Barrel
1459  for (unsigned int digis=0; digis<ebDigis_->size(); ++digis){
1460  EBDataFrame ebdf = (*ebDigis_)[digis];
1461  anaDigi(ebdf, *ebSrFlags_);
1462  }
1463 
1464  // Endcap
1465  for (unsigned int digis=0; digis<eeDigis_->size(); ++digis){
1466  EEDataFrame eedf = (*eeDigis_)[digis];
1467  anaDigi(eedf, *eeSrFlags_);
1468  }
1469 
1470  //histos
1471  for(unsigned iDcc0 = 0; iDcc0 < nDccs_; ++iDcc0){
1472  fill(meDccVol_, iDcc0+1, getDccEventSize(iDcc0, nPerDcc_[iDcc0])/kByte_);
1473  fill(meDccLiVol_, iDcc0+1,
1474  getDccSrDependentPayload(iDcc0, nLiRuPerDcc_[iDcc0],
1475  nLiPerDcc_[iDcc0])/kByte_);
1476  fill(meDccHiVol_, iDcc0+1,
1477  getDccSrDependentPayload(iDcc0, nHiRuPerDcc_[iDcc0],
1478  nHiPerDcc_[iDcc0])/kByte_);
1479  const FEDRawDataCollection& raw = *fedRaw_;
1480  fill(meDccVolFromData_, iDcc0+1,
1481  ((double)raw.FEDData(601+iDcc0).size())/kByte_);
1482  }
1483 
1484 
1485  //low interesest channels:
1486  double a = nEbLI_*getBytesPerCrystal()/kByte_; //getEbEventSize(nEbLI_)/kByte_;
1487  fill(meVolBLI_, a);
1488  double b = nEeLI_*getBytesPerCrystal()/kByte_; //getEeEventSize(nEeLI_)/kByte_;
1489  fill(meVolELI_, b);
1490  fill(meVolLI_, a+b);
1491 
1492  //high interest chanels:
1493  a = nEbHI_*getBytesPerCrystal()/kByte_; //getEbEventSize(nEbHI_)/kByte_;
1494  fill(meVolBHI_, a);
1495  b = nEeHI_*getBytesPerCrystal()/kByte_; //getEeEventSize(nEeHI_)/kByte_;
1496  fill(meVolEHI_, b);
1497  fill(meVolHI_, a+b);
1498 
1499  //any-interest channels:
1500  a = getEbEventSize(nEb_)/kByte_;
1501  fill(meVolB_, a);
1502  b = getEeEventSize(nEe_)/kByte_;
1503  fill(meVolE_, b);
1504  fill(meVol_, a+b);
1505 }
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 1059 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(), CaloRecHit::energy(), PCaloHit::energy(), PV3DBase< T, PVType, FrameType >::eta(), EcalSelectiveReadoutValidation::energiesEb_t::eta, edm::hlt::Exception, fill(), firstFIRSample_, firWeights_, 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_, 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(), lumiQTWidget::t, findQualityFiles::v, EcalSrFlag::value(), withEbSimHit_, xtalGraphX(), xtalGraphY(), and EcalTrigTowerDetId::zside().

Referenced by analyze().

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

References edm::DataFrameContainer::begin(), dccCh(), dccZsFIR(), DetId::Ecal, EcalEndcap, eeDigis_, eeEnergies, eeNoZsDigis_, eeRecHits_, eeSimHits_, eeSrFlags_, eeZsThr_, edm::DataFrameContainer::end(), CaloRecHit::energy(), PCaloHit::energy(), PV3DBase< T, PVType, FrameType >::eta(), EcalSelectiveReadoutValidation::energiesEe_t::eta, edm::hlt::Exception, fill(), firstFIRSample_, firWeights_, frame2Energy(), EcalSelectiveReadoutValidation::energiesEe_t::gain12, ecalMGPA::gainId(), geometry, edm::EventSetup::get(), CaloSubdetectorGeometry::getGeometry(), i, EEDataFrame::id(), EESrFlag::id(), PCaloHit::id(), EcalRecHit::id(), ievt_, isRuComplete_, EcalScDetId::ix(), EEDetId::ix(), iXY2cIndex(), EcalScDetId::iy(), EEDetId::iy(), localReco_, 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, lumiQTWidget::t, findQualityFiles::v, EcalSrFlag::value(), withEeSimHit_, xtalGraphX(), xtalGraphY(), EcalScDetId::zside(), and EEDetId::zside().

Referenced by analyze().

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

1383  {
1384  EcalTPGScale ecalScale;
1385 #if (CMSSW_COMPAT_VERSION>=210)
1386  ecalScale.setEventSetup(es) ;
1387 #endif
1388 
1389  // std::cout << __FILE__ << __LINE__
1390  // << "n TP: " << tps_->size() <<std::endl;
1391 
1393  it != tps_->end(); ++it){
1394  // for(int i = 0; i < it->size(); ++i){
1395  // double v = (*it)[i].raw() & 0xFF;
1396  // if(v>0) std::cout << v << " " << i << std::endl;
1397  //}
1398  // if(it->compressedEt() > 0){
1399  // std::cout << "---------> " << it->id().ieta() << ", "
1400  // << it->id().iphi() << ", "
1401  // << it->compressedEt() << std::endl;
1402  //}
1403 
1404  //const int iTcc = elecMap_->TCCid(it->id());
1405  //const int iTt = elecMap_->iTt(it->id());
1406  double tpEt;
1407  if(tpInGeV_){
1408 #if (CMSSW_COMPAT_VERSION<210)
1409  tpEt = ecalScale.getTPGInGeV(es, *it);
1410 #else
1411  tpEt = ecalScale.getTPGInGeV(it->compressedEt(), it->id()) ;
1412 #endif
1413  } else{
1414  tpEt = it->compressedEt();
1415  }
1416  int iEta = it->id().ieta();
1417  int iEta0 = iTtEta2cIndex(iEta);
1418  int iPhi = it->id().iphi();
1419  int iPhi0 = iTtEta2cIndex(iPhi);
1420  double etSum = ttEtSums[iEta0][iPhi0];
1421  fill(meTp_, tpEt);
1422  fill(meTpVsEtSum_, etSum, tpEt);
1423  fill(meTtf_, it->ttFlag());
1424  if((it->ttFlag() & 0x3) == 0){
1425  fill(meLiTtf_, iEta, iPhi);
1426  }
1427  if((it->ttFlag() & 0x3) == 1){
1428  fill(meMiTtf_, iEta, iPhi);
1429  }
1430  if((it->ttFlag() & 0x3) == 3){
1431  fill(meHiTtf_, iEta, iPhi);
1432  }
1433  if((it->ttFlag() & 0x4)){
1434  fill(meForcedTtf_, iEta, iPhi);
1435  }
1436 
1437  fill(meTtfVsTp_, tpEt, it->ttFlag());
1438  fill(meTtfVsEtSum_, etSum, it->ttFlag());
1439  fill(meTpMap_, iEta, iPhi, tpEt, 1.);
1440  }
1441 }
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 1361 of file EcalSelectiveReadoutValidation.cc.

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

1361  {
1362  // endcap mapping
1364  es.get<IdealGeometryRecord>().get(hTriggerTowerMap);
1365  triggerTowerMap_ = hTriggerTowerMap.product();
1366 
1367  //electronics map
1369  es.get< EcalMappingRcd >().get(ecalmapping);
1370  elecMap_ = ecalmapping.product();
1371 
1372  initAsciiFile();
1373 }
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 1932 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by EcalSelectiveReadoutValidation().

1932  {
1933  if(!registerHist(name, title)) return 0; //this histo is disabled
1935  if(result==0){
1936  throw cms::Exception("Histo")
1937  << "Failed to book histogram " << name;
1938  }
1939  return result;
1940 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:873
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 1942 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by EcalSelectiveReadoutValidation().

1942  {
1943  if(!registerHist(name, title)) return 0; //this histo is disabled
1945  nybins, ymin, ymax);
1946  if(result==0){
1947  throw cms::Exception("Histo")
1948  << "Failed to book histogram " << name;
1949  }
1950  return result;
1951 }
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:1001
MonitorElement * EcalSelectiveReadoutValidation::bookFloat ( const std::string &  name)
private

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

Definition at line 1921 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by EcalSelectiveReadoutValidation().

1921  {
1922  if(!registerHist(name, "")) return 0; //this histo is disabled
1924  if(result==0){
1925  throw cms::Exception("DQM")
1926  << "Failed to book integer DQM monitor element" << name;
1927  }
1928  return result;
1929 }
bool registerHist(const std::string &name, const std::string &title)
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:810
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 1953 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by EcalSelectiveReadoutValidation().

1953  {
1954  if(!registerHist(name, title)) return 0; //this histo is disabled
1956  0, 0, 0);
1957  if(result==0){
1958  throw cms::Exception("Histo")
1959  << "Failed to book histogram " << name;
1960  }
1961  return result;
1962 }
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:1187
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 1964 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by EcalSelectiveReadoutValidation().

1964  {
1965  if(!registerHist(name, title)) return 0; //this histo is disabled
1967  = dbe_->bookProfile2D(name,
1968  title,
1969  nbinx, xmin, xmax,
1970  nbiny, ymin, ymax,
1971  0, 0, 0,
1972  option);
1973  if(result==0){
1974  throw cms::Exception("Histo")
1975  << "Failed to book histogram " << name;
1976  }
1977  return result;
1978 }
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:1331
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 2334 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyze().

2335  {
2336  typedef typename T::const_iterator SrFlagCollectionConstIt;
2337  typedef typename T::key_type MyRuDetIdType;
2338 
2339  for(SrFlagCollectionConstIt itSrf = srfs.begin();
2340  itSrf != srfs.end(); ++itSrf){
2341  int flag = itSrf->value() & ~EcalSrFlag::SRF_FORCED_MASK;
2342  pair<int,int> ru = dccCh(itSrf->id());
2343 
2344  if(flag == EcalSrFlag::SRF_FULL){
2345  if(nPerRu_[ru.first-minDccId_][ru.second-1]==getCrystalCount(ru.first, ru.second)){ //no error
2346  fill(meIncompleteFRORateMap_, ruGraphX(itSrf->id()),
2347  ruGraphY(itSrf->id()), 0);
2349  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2350  } else if(nPerRu_[ru.first-minDccId_][ru.second-1]==0) {//tower dropped!
2352  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2354  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2355  fill(meDroppedFROMap_, ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2356  ++nDroppedFRO_;
2357  srApplicationErrorLog_ << event.id() << ": Flag of RU "
2358  << itSrf->id() << " (DCC " << ru.first
2359  << " ch " << ru.second << ") is 'Full readout' "
2360  << "while none of its channel was read out\n";
2361  } else{ //tower partially read out
2363  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2365  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2367  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2368  ++nIncompleteFRO_;
2369  srApplicationErrorLog_ << event.id() << ": Flag of RU"
2370  << itSrf->id() << " (DCC " << ru.first
2371  << " ch " << ru.second << ") is 'Full readout' "
2372  << "while only "
2373  << nPerRu_[ru.first-minDccId_][ru.second-1]
2374  << " / " << getCrystalCount(ru.first, ru.second)
2375  << " channels were read out.\n";
2376  }
2377  }
2378 
2379  if(flag == EcalSrFlag::SRF_ZS1 || flag == EcalSrFlag::SRF_ZS2){
2380  if(nPerRu_[ru.first-minDccId_][ru.second-1]
2381  ==getCrystalCount(ru.first, ru.second)){
2382  //ZS readout unit whose every channel was read
2383 
2384  fill(meCompleteZSMap_, ruGraphX(itSrf->id()), ruGraphY(itSrf->id()));
2386  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 1);
2387  //srApplicationErrorLog_ << event.id() << ": "
2388  // << "All " << nMaxXtalPerRu << " channels of RU "
2389  // << itSrf->id() << " passed the Zero suppression.";
2390  ++nCompleteZS_;
2391  } else{
2393  ruGraphX(itSrf->id()), ruGraphY(itSrf->id()), 0);
2394  }
2395  }
2396  }
2397 }
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 2202 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyze().

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

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

Referenced by EcalSelectiveReadoutValidation().

2131  {
2132  bool notNormalized = false;
2133  bool notInt = false;
2134  for(unsigned i=0; i < weightsForZsFIR.size(); ++i){
2135  if(weightsForZsFIR[i] > 1.) notNormalized = true;
2136  if((int)weightsForZsFIR[i]!=weightsForZsFIR[i]) notInt = true;
2137  }
2138  if(notInt && notNormalized){
2139  throw cms::Exception("InvalidParameter")
2140  << "weigtsForZsFIR paramater values are not valid: they "
2141  << "must either be integer and uses the hardware representation "
2142  << "of the weights or less or equal than 1 and used the normalized "
2143  << "representation.";
2144  }
2145  LogInfo log("DccFir");
2146  if(notNormalized){
2147  firWeights_ = vector<int>(weightsForZsFIR.size());
2148  for(unsigned i = 0; i< weightsForZsFIR.size(); ++i){
2149  firWeights_[i] = (int)weightsForZsFIR[i];
2150  }
2151  } else{
2152  firWeights_ = getFIRWeights(weightsForZsFIR);
2153  }
2154 
2155  log << "Input weights for FIR: ";
2156  for(unsigned i = 0; i < weightsForZsFIR.size(); ++i){
2157  log << weightsForZsFIR[i] << "\t";
2158  }
2159 
2160  double s2 = 0.;
2161  log << "\nActual FIR weights: ";
2162  for(unsigned i = 0; i < firWeights_.size(); ++i){
2163  log << firWeights_[i] << "\t";
2164  s2 += firWeights_[i]*firWeights_[i];
2165  }
2166 
2167  s2 = sqrt(s2);
2168  log << "\nNormalized FIR weights after hw representation rounding: ";
2169  for(unsigned i = 0; i < firWeights_.size(); ++i){
2170  log << firWeights_[i] / (double)(1<<10) << "\t";
2171  }
2172 
2173  log <<"\nFirst FIR sample: " << firstFIRSample_;
2174 }
int i
Definition: DBlmapReader.cc:9
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 1666 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().

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

References elecMap_, and EcalElectronicsMapping::getDCCandSC().

Referenced by selectFedsForLog().

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

Definition at line 2276 of file EcalSelectiveReadoutValidation.cc.

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

2276  {
2277  if(detId.ietaAbs()>17){
2278  throw cms::Exception("InvalidArgument")
2279  << "Argument of EcalSelectiveReadoutValidation::dccId(const EcalTrigTowerDetId&) "
2280  << "must be a barrel trigger tower Id\n";
2281  }
2282  return dccCh(detId).first;
2283 
2284  // int iDccPhi0 = (detId.iphi()-1)/4; //4 TT along phi covered by a DCC
2285  // int iDccEta0 = detId.zside()<0?0:1;
2286  // const int nDccsInPhi = 18;
2287  // return 1 + iDccEta0 * nDccsInPhi + iDccPhi0;
2288 }
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 2067 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyzeEB(), and analyzeEE().

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

Calls at end of run.

Reimplemented from edm::EDAnalyzer.

Definition at line 1375 of file EcalSelectiveReadoutValidation.cc.

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

1375  {
1378  if(outputFile_.size()!=0) dbe_->save(outputFile_);
1379 }
void Fill(long long x)
std::string outputFile_
Output file for histograms.
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2297
DQMStore * dbe_
Histogramming interface.
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  }
float float float z
void Fill(long long x)
T w() const
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 1620 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyzeEB(), and analyzeEE().

1620  {
1621  static bool firstCall = true;
1622  if(firstCall){
1623  stringstream buf;
1624  buf << "Weights:";
1625  for(unsigned i=0; i<weights_.size();++i){
1626  buf << "\t" << weights_[i];
1627  }
1628  edm::LogInfo("EcalSrValid") << buf.str() << "\n";
1629  firstCall = false;
1630  }
1631  double adc2GeV = 0.;
1632 
1633  if(typeid(EBDataFrame)==typeid(frame)){//barrel APD
1634  adc2GeV = .035;
1635  } else if(typeid(EEDataFrame)==typeid(frame)){//endcap VPT
1636  adc2GeV = 0.06;
1637  } else{
1638  assert(false);
1639  }
1640 
1641  double acc = 0;
1642 
1643  const int n = min(frame.size(), (int)weights_.size());
1644 
1645  double gainInv[] = {12., 1., 6., 12.};
1646 
1647  for(int i=0; i < n; ++i){
1648  acc += weights_[i]*frame[i].adc()*gainInv[frame[i].gainId()]*adc2GeV;
1649  }
1650  return acc;
1651 }
int i
Definition: DBlmapReader.cc:9
int size() const
Definition: EcalDataFrame.h:26
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 1883 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by setTtEtSums().

1884  {
1885  //we have to start by 0 in order to handle offset=-1
1886  //(however Fenix FIR has AFAK only 5 taps)
1887  double weights[] = {0., -1/3., -1/3., -1/3., 0., 1.};
1888 
1889  double adc2GeV = 0.;
1890  if(typeid(frame) == typeid(EBDataFrame)){
1891  adc2GeV = 0.035;
1892  } else if(typeid(frame) == typeid(EEDataFrame)){
1893  adc2GeV = 0.060;
1894  } else{ //T is an invalid type!
1895  //TODO: replace message by a cms exception
1896  throw cms::Exception("Severe Error")
1897  << __FILE__ << ":" << __LINE__ << ": "
1898  << "this is a bug. Please report it.\n";
1899  }
1900 
1901  double acc = 0;
1902 
1903  const int n = min<int>(frame.size(), sizeof(weights)/sizeof(weights[0]));
1904 
1905  double gainInv[] = {12., 1., 6., 12};
1906 
1907  for(int i=offset; i < n; ++i){
1908  int iframe = i + offset;
1909  if(iframe>=0 && iframe<frame.size()){
1910  acc += weights[i]*frame[iframe].adc()
1911  *gainInv[frame[iframe].gainId()]*adc2GeV;
1912  //cout << (iframe>offset?"+":"")
1913  // << frame[iframe].adc() << "*" << gainInv[frame[iframe].gainId()]
1914  // << "*" << adc2GeV << "*(" << weights[i] << ")";
1915  }
1916  }
1917  //cout << "\n";
1918  return acc;
1919 }
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 2399 of file EcalSelectiveReadoutValidation.cc.

References maxDccId_.

Referenced by analyzeDataVolume(), and checkSrApplication().

2399  {
2400  if(iDcc < minDccId_ || iDcc > maxDccId_){ //invalid DCC
2401  return 0;
2402  } else if (10 <= iDcc && iDcc <= 45) {//EB
2403  return 25;
2404  } else { //EE
2405  int iDccPhi;
2406  if(iDcc < 10) iDccPhi = iDcc;
2407  else iDccPhi = iDcc - 45;
2408  switch(iDccPhi*100+iDccCh){
2409  case 110:
2410  case 232:
2411  case 312:
2412  case 412:
2413  case 532:
2414  case 610:
2415  case 830:
2416  case 806:
2417  //inner partials at 12, 3, and 9 o'clock
2418  return 20;
2419  case 134:
2420  case 634:
2421  case 827:
2422  case 803:
2423  return 10;
2424  case 330:
2425  case 430:
2426  return 20;
2427  case 203:
2428  case 503:
2429  case 721:
2430  case 921:
2431  return 21;
2432  default:
2433  return 25;
2434  }
2435  }
2436 }
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 2015 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyzeDataVolume().

2015  {
2016  double ruHeaderPayload = 0.;
2017  const int firstEbDcc0 = nEeDccs/2;
2018  for(int iDcc0 = firstEbDcc0; iDcc0 < firstEbDcc0 + nEbDccs; ++iDcc0){
2019  ruHeaderPayload += getRuCount(iDcc0)*8.;
2020  }
2021 
2022  return getDccOverhead(EB)*nEbDccs + nReadXtals*getBytesPerCrystal()
2023  + ruHeaderPayload;
2024 }
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 2026 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyzeDataVolume().

2026  {
2027  double ruHeaderPayload = 0.;
2028  const unsigned firstEbDcc0 = nEeDccs/2;
2029  for(unsigned iDcc0 = 0; iDcc0 < nDccs_; ++iDcc0){
2030  //skip barrel:
2031  if(iDcc0== firstEbDcc0) iDcc0 += nEbDccs;
2032  ruHeaderPayload += getRuCount(iDcc0)*8.;
2033  }
2034  return getDccOverhead(EE)*nEeDccs + nReadXtals*getBytesPerCrystal()
2035  + ruHeaderPayload;
2036 }
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 2116 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by configFirWeights().

2117  {
2118  const int nFIRTaps = 6;
2119  vector<int> firWeights(nFIRTaps, 0); //default weight: 0;
2120  const static int maxWeight = 0xEFF; //weights coded on 11+1 signed bits
2121  for(unsigned i=0; i < min((size_t)nFIRTaps,normalizedWeights.size()); ++i){
2122  firWeights[i] = lround(normalizedWeights[i] * (1<<10));
2123  if(abs(firWeights[i])>maxWeight){//overflow
2124  firWeights[i] = firWeights[i]<0?-maxWeight:maxWeight;
2125  }
2126  }
2127  return firWeights;
2128 }
int i
Definition: DBlmapReader.cc:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double EcalSelectiveReadoutValidation::getL1aRate ( ) const
private

Gets L1A rate estimate.

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

Definition at line 702 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by endRun().

702  {
703  LogDebug("EcalSrValid") << __FILE__ << ":" << __LINE__ << ": "
704  << "Tmax = " << tmax << " x 25ns; Tmin = " << tmin
705  << " x 25ns; L1A(Tmax) = " << l1aOfTmax << "; L1A(Tmin) = "
706  << l1aOfTmin << "\n";
707  return (double)(l1aOfTmax - l1aOfTmin) / ((tmax-tmin) * 25e-9);
708 }
#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 1653 of file EcalSelectiveReadoutValidation.cc.

References nRuPerDcc_.

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

1653  {
1654  // static int nEemRu[] = {34, 32, 33, 33, 32, 34, 33, 34, 33};
1655  // static int nEepRu[] = {32, 33, 33, 32, 34, 33, 34, 33, 34};
1656  // if(iDcc0<9){//EE-
1657  // return nEemRu[iDcc0];
1658  // } else if(iDcc0>=45){//EE+
1659  // return nEepRu[iDcc0-45];
1660  // } else{//EB
1661  // return 68;
1662  // }
1663  return nRuPerDcc_[iDcc0];
1664 }
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 2176 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by beginRun().

2176  {
2177  if(logSrpAlgoErrors_){
2179  if(!srpAlgoErrorLog_.good()){
2180  throw cms::Exception("Output")
2181  << "Failed to open the log file '"
2183  << "' for SRP algorithm result check.\n";
2184  }
2185  }
2186 
2189  if(!srApplicationErrorLog_.good()){
2190  throw cms::Exception("Output")
2191  << "Failed to open the log file '"
2193  << "' for Selective Readout decision application check.\n";
2194  }
2195  }
2196 }
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 2038 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().

2038  {
2041  //meEbLiZsFir_, meEbHiZsFir_,
2042  //meEeLiZsFir_, meEeHiZsFir_,
2043  };
2044 
2045  double scale = 1./eventCount;
2046  stringstream buf;
2047  for(unsigned i = 0; i < sizeof(mes)/sizeof(mes[0]); ++i){
2048  if(mes[i] == 0) continue;
2049  TH1* h = mes[i]->getTH1();
2050  if(dynamic_cast<TH2*>(h)){//TH2
2051  h->GetZaxis()->SetTitle("Frequency");
2052  } else{ //assuming TH1
2053  h->GetYaxis()->SetTitle("<Count>");
2054  }
2055  buf << "Normalising " << h->GetName() << ". Factor: " << scale << "\n";
2056  h->Scale(scale);
2057  //Set average bit so histogram can be added correctly. Beware must be done
2058  //after call the TH1::Scale (Scale has no effect if average bit is set)
2059  h->SetBit(TH1::kIsAverage);
2060  }
2061  edm::LogInfo("EcalSrValid") << buf.str();
2062 }
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 2003 of file EcalSelectiveReadoutValidation.cc.

References availableHistList_, and create_public_lumi_plots::log.

Referenced by EcalSelectiveReadoutValidation().

2003  {
2004  LogInfo log("HistoList");
2005  log << "Avalailable histograms (DQM monitor elements): \n";
2006  for(map<string, string>::iterator it = availableHistList_.begin();
2007  it != availableHistList_.end();
2008  ++it){
2009  log << it->first << ": " << it->second << "\n";
2010  }
2011  log << "\nTo include an histogram add its name in the vstring parameter "
2012  "'histograms' of the EcalSelectiveReadoutValidation module\n";
2013 }
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 1986 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().

1986  {
1987  ebRecHits_.read(event);
1988  eeRecHits_.read(event);
1989  ebDigis_.read(event);
1990  eeDigis_.read(event);
1993  ebSrFlags_.read(event);
1994  eeSrFlags_.read(event);
1995  ebComputedSrFlags_.read(event);
1996  eeComputedSrFlags_.read(event);
1999  tps_.read(event);
2000  fedRaw_.read(event);
2001 }
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:50
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 1778 of file EcalSelectiveReadoutValidation.cc.

References EcalTrigTowerConstituentsMap::towerOf(), and triggerTowerMap_.

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

1778  {
1779  return triggerTowerMap_->towerOf(xtalId);
1780 }
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 1783 of file EcalSelectiveReadoutValidation.cc.

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

1783  {
1784  // return superCrystalOf(xtalId);
1785  const EcalElectronicsId& EcalElecId = elecMap_->getElectronicsId(xtalId);
1786  int iDCC= EcalElecId.dccId();
1787  int iDccChan = EcalElecId.towerId();
1788  const bool ignoreSingle = true;
1789  const vector<EcalScDetId> id = elecMap_->getEcalScDetId(iDCC, iDccChan, ignoreSingle);
1790  return id.size()>0?id[0]:EcalScDetId();
1791 }
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 1980 of file EcalSelectiveReadoutValidation.cc.

References allHists_, availableHistList_, and histList_.

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

1981  {
1982  availableHistList_.insert(pair<string, string>(name, title));
1983  return allHists_ || histList_.find(name)!=histList_.end();
1984 }
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 2292 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyze().

2292  {
2293  logErrForDccs_ = vector<bool>(nDccs_, false);
2294 
2296  it != ebSrFlags_->end();
2297  ++it){
2298 
2299  //cout << __FILE__ << ":" << __LINE__ << ": "
2300  // << EcalTrigTowerDetId(it->id()) << "\n";
2301 
2302  int iDcc = dccId(it->id()) - minDccId_;
2303  // cout << __FILE__ << ":" << __LINE__ << ": "
2304  // << it->id().rawId() << "-> DCC " << (iDcc+1) << "\n";
2305  logErrForDccs_.at(iDcc) = true;
2306  }
2307 
2309  it != eeSrFlags_->end();
2310  ++it){
2311  int iDcc = dccId(it->id()) - minDccId_;
2312 // cout << __FILE__ << ":" << __LINE__ << ": "
2313 // << it->id().rawId() << "-> DCC " << (iDcc+1) << "\n";
2314  logErrForDccs_.at(iDcc) = true;
2315  }
2316 
2317  stringstream buf;
2318  buf << "List of DCCs found in the first processed event: ";
2319  bool first = true;
2320  for(unsigned iDcc = 0; iDcc < nDccs_; ++iDcc){
2321  if(logErrForDccs_[iDcc]){
2322  buf << (first?"":", ") << (iDcc + minDccId_);
2323  first = false;
2324  }
2325  }
2326  buf << "\nOnly DCCs from this list will be considered for error logging\n";
2327  srpAlgoErrorLog_ << buf.str();
2328  srApplicationErrorLog_<< buf.str();
2329  LogInfo("EcalSrValid") << buf;
2330 }
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:79
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 1794 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().

1796  {
1797  //ecal geometry:
1798  static const CaloSubdetectorGeometry* eeGeometry = 0;
1799  static const CaloSubdetectorGeometry* ebGeometry = 0;
1800  if(eeGeometry==0 || ebGeometry==0){
1801  edm::ESHandle<CaloGeometry> geoHandle;
1802  es.get<MyCaloGeometryRecord>().get(geoHandle);
1803  eeGeometry
1804  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
1805  ebGeometry
1806  = (*geoHandle).getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
1807  }
1808 
1809  //init etSum array:
1810  for(int iEta0 = 0; iEta0 < nTtEta; ++iEta0){
1811  for(int iPhi0 = 0; iPhi0 < nTtPhi; ++iPhi0){
1812  ttEtSums[iEta0][iPhi0] = 0.;
1813  }
1814  }
1815 
1817  it != ebDigis_->end(); ++it){
1818  const EBDataFrame& frame = *it;
1819  const EcalTrigTowerDetId& ttId = triggerTowerMap_->towerOf(frame.id());
1820  // LogDebug("TT")
1821  // << ((EBDetId&)frame.id()).ieta()
1822  // << "," << ((EBDetId&)frame.id()).iphi()
1823  // << " -> " << ttId.ieta() << "," << ttId.iphi();
1824  const int iTtEta0 = iTtEta2cIndex(ttId.ieta());
1825  const int iTtPhi0 = iTtPhi2cIndex(ttId.iphi());
1826  double theta = ebGeometry->getGeometry(frame.id())->getPosition().theta();
1827  double e = frame2EnergyForTp(frame);
1828  if((frame2EnergyForTp(frame,-1) < e) && (frame2EnergyForTp(frame, 1) < e)){
1829  ttEtSums[iTtEta0][iTtPhi0] += e*sin(theta);
1830  }
1831  }
1832 
1833  for(EEDigiCollection::const_iterator it = eeDigis.begin();
1834  it != eeDigis.end(); ++it){
1835  const EEDataFrame& frame = *it;
1836  const EcalTrigTowerDetId& ttId = triggerTowerMap_->towerOf(frame.id());
1837  const int iTtEta0 = iTtEta2cIndex(ttId.ieta());
1838  const int iTtPhi0 = iTtPhi2cIndex(ttId.iphi());
1839  // LogDebug("TT") << ": EE xtal->TT "
1840  // << ((EEDetId&)frame.id()).ix()
1841  // << "," << ((EEDetId&)frame.id()).iy()
1842  // << " -> " << ttId.ieta() << "," << ttId.iphi() << "\n";
1843  double theta = eeGeometry->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  //dealing with pseudo-TT in two inner EE eta-ring:
1851  int innerTTEtas[] = {0, 1, 54, 55};
1852  for(unsigned iRing = 0; iRing < sizeof(innerTTEtas)/sizeof(innerTTEtas[0]);
1853  ++iRing){
1854  int iTtEta0 = innerTTEtas[iRing];
1855  //this detector eta-section is divided in only 36 phi bins
1856  //For this eta regions,
1857  //current tower eta numbering scheme is inconsistent. For geometry
1858  //version 133:
1859  //- TT are numbered from 0 to 72 for 36 bins
1860  //- some TT have an even index, some an odd index
1861  //For geometry version 125, there are 72 phi bins.
1862  //The code below should handle both geometry definition.
1863  //If there are 72 input trigger primitives for each inner eta-ring,
1864  //then the average of the trigger primitive of the two pseudo-TT of
1865  //a pair (nEta, nEta+1) is taken as Et of both pseudo TTs.
1866  //If there are only 36 input TTs for each inner eta ring, then half
1867  //of the present primitive of a pseudo TT pair is used as Et of both
1868  //pseudo TTs.
1869 
1870  for(unsigned iTtPhi0 = 0; iTtPhi0 < nTtPhi-1; iTtPhi0 += 2){
1871  double et = .5*(ttEtSums[iTtEta0][iTtPhi0]
1872  +ttEtSums[iTtEta0][iTtPhi0+1]);
1873  //divides the TT into 2 phi bins in order to match with 72 phi-bins SRP
1874  //scheme or average the Et on the two pseudo TTs if the TT is already
1875  //divided into two trigger primitives.
1876  ttEtSums[iTtEta0][iTtPhi0] = et;
1877  ttEtSums[iTtEta0][iTtPhi0+1] = et;
1878  }
1879  }
1880 }
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
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
unsigned ttId(const DetId &)
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 1739 of file EcalSelectiveReadoutValidation.cc.

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

1740 {
1741 
1742  const int scEdge = 5;
1743  EcalScDetId id = EcalScDetId((xtalId.ix()-1)/scEdge+1,
1744  (xtalId.iy()-1)/scEdge+1,
1745  xtalId.zside());
1746  return id;
1747  /*
1748  const EcalElectronicsId& EcalElecId = elecMap_->getElectronicsId(xtalId);
1749  int iDCC= EcalElecId.dccId();
1750  int iDccChan = EcalElecId.towerId();
1751  const vector<EcalScDetId> id = elecMap_->getEcalScDetId(iDCC, iDccChan);
1752 
1753  if(SkipInnerSC_)
1754  {
1755  if( (id.ix()>=9 && id.ix()<=12) && (id.iy()>=9 && id.iy()<=12) )
1756  return EcalScDetId();
1757  else
1758  return id;
1759  }
1760  else
1761  {
1762  if(id.ix()==9 && id.iy()==9)
1763  return EcalScDetId(2,5,xtalId.zside());
1764  else if(id.ix()==9 && id.iy()==12)
1765  return EcalScDetId(1,13,xtalId.zside());
1766  else if(id.ix()==12 && id.iy()==9)
1767  return EcalScDetId(19,5,xtalId.zside());
1768  else if(id.ix()==12 && id.iy()==12)
1769  return EcalScDetId(20,13,xtalId.zside());
1770  else
1771  return id;
1772  }
1773  */
1774 }
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 684 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyze().

684  {
685  const int32_t bx = event.bunchCrossing();
686  if(bx<1 || bx > 3564) return;//throw cms::Exception("EcalSelectiveReadoutValidation")
687  // << "bx value, " << bx << " is out of range\n";
688 
689  int64_t t = event.bunchCrossing() + (event.orbitNumber()-1)*3564;
690 
691  if(t<tmin){
692  tmin = t;
693  l1aOfTmin = event.id().event();
694  }
695 
696  if(t>tmax){
697  tmax = t;
698  l1aOfTmax = event.id().event();
699  }
700 }
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

Definition at line 549 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and readAllCollections().

CollHandle<EBDigiCollection> EcalSelectiveReadoutValidation::ebDigis_
private

The event product collections.

Definition at line 543 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), analyzeEB(), 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

Definition at line 545 of file EcalSelectiveReadoutValidation.h.

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

CollHandle<RecHitCollection> EcalSelectiveReadoutValidation::ebRecHits_
private

Definition at line 554 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and readAllCollections().

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

Definition at line 551 of file EcalSelectiveReadoutValidation.h.

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

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

Definition at line 550 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and readAllCollections().

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

Definition at line 546 of file EcalSelectiveReadoutValidation.h.

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

CollHandle<RecHitCollection> EcalSelectiveReadoutValidation::eeRecHits_
private

Definition at line 555 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and readAllCollections().

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

Definition at line 552 of file EcalSelectiveReadoutValidation.h.

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

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

Definition at line 556 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeDataVolume(), and readAllCollections().

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

Definition at line 553 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), analyzeTP(), and readAllCollections().

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.