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

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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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 (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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 49 of file EcalSelectiveReadoutValidation.h.

Member Typedef Documentation

Definition at line 54 of file EcalSelectiveReadoutValidation.h.

Definition at line 53 of file EcalSelectiveReadoutValidation.h.

Member Enumeration Documentation

distinguishes barral and endcap of ECAL.

Enumerator
EB 
EE 

Definition at line 77 of file EcalSelectiveReadoutValidation.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 96 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_, lumiQTWidget::t, indexGen::title, tpInGeV_, and verbose_.

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

1360  {
1361 }

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 1511 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().

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

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

Referenced by analyzeDataVolume().

1604  {
1605  nEb_ = 0;
1606  nEe_ = 0;
1607  nEeLI_ = 0;
1608  nEeHI_ = 0;
1609  nEbLI_ = 0;
1610  nEbHI_ = 0;
1611  bzero(nPerDcc_, sizeof(nPerDcc_));
1612  bzero(nLiPerDcc_, sizeof(nLiPerDcc_));
1613  bzero(nHiPerDcc_, sizeof(nHiPerDcc_));
1614  bzero(nRuPerDcc_, sizeof(nRuPerDcc_));
1615  bzero(ebRuActive_, sizeof(ebRuActive_));
1616  bzero(eeRuActive_, sizeof(eeRuActive_));
1617  bzero(nPerRu_, sizeof(nPerRu_));
1618  bzero(nLiRuPerDcc_, sizeof(nLiRuPerDcc_));
1619  bzero(nHiRuPerDcc_, sizeof(nHiRuPerDcc_));
1620 }
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 712 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_.

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

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

Referenced by analyze().

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

Referenced by analyze().

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

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

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

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

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

Referenced by EcalSelectiveReadoutValidation().

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

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

Referenced by EcalSelectiveReadoutValidation().

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

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

Definition at line 1923 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by EcalSelectiveReadoutValidation().

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

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

Referenced by EcalSelectiveReadoutValidation().

1955  {
1956  if(!registerHist(name, title)) return 0; //this histo is disabled
1957  MonitorElement* result = dbe_->bookProfile(name, title, nbins, xmin, xmax,
1958  0, 0, 0);
1959  if(result==0){
1960  throw cms::Exception("Histo")
1961  << "Failed to book histogram " << name;
1962  }
1963  return result;
1964 }
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:1031
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 1966 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by EcalSelectiveReadoutValidation().

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

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

Referenced by dccCh().

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

converse of iPhi2cIndex() method.

Definition at line 284 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh().

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

converse of iTtEta2cIndex() method.

Definition at line 311 of file EcalSelectiveReadoutValidation.h.

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

converse of iTtPhi2cIndex() method.

Definition at line 317 of file EcalSelectiveReadoutValidation.h.

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

converse of iXY2cIndex() method.

Definition at line 271 of file EcalSelectiveReadoutValidation.h.

271  {
272  return iX0+1;
273  }
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 2204 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyze().

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

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

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

References elecMap_, and EcalElectronicsMapping::getDCCandSC().

Referenced by selectFedsForLog().

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

Definition at line 2278 of file EcalSelectiveReadoutValidation.cc.

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

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

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

Referenced by analyzeEB(), and analyzeEE().

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

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

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

Wrapper to fill methods of DQM monitor elements.

Definition at line 390 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

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

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

Definition at line 393 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

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

Definition at line 396 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

396  {
397  if(me) me->Fill(x, y, zw);
398  }
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 399 of file EcalSelectiveReadoutValidation.h.

References MonitorElement::Fill().

399  {
400  if(me) me->Fill(x, y, z, w);
401  }
double double double z
void Fill(long long x)
Definition: DDAxes.h:10
T w() const
double EcalSelectiveReadoutValidation::frame2Energy ( const EcalDataFrame frame) const
private

Energy reconstruction from ADC samples.

Parameters
framethe ADC sample of an ECA channel

Definition at line 1622 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyzeEB(), and analyzeEE().

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

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

Referenced by setTtEtSums().

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

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

171  {
172  return 3*8;
173  }
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 2401 of file EcalSelectiveReadoutValidation.cc.

References maxDccId_.

Referenced by analyzeDataVolume(), and checkSrApplication().

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

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

Referenced by analyzeDataVolume().

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

References EB.

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

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

References getBytesPerCrystal().

Referenced by analyzeDataVolume(), and getDccEventSize().

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

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

Referenced by analyzeDataVolume().

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

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

Referenced by analyzeDataVolume().

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

References abs, i, and min.

Referenced by configFirWeights().

2119  {
2120  const int nFIRTaps = 6;
2121  vector<int> firWeights(nFIRTaps, 0); //default weight: 0;
2122  const static int maxWeight = 0xEFF; //weights coded on 11+1 signed bits
2123  for(unsigned i=0; i < min((size_t)nFIRTaps,normalizedWeights.size()); ++i){
2124  firWeights[i] = lround(normalizedWeights[i] * (1<<10));
2125  if(abs(firWeights[i])>maxWeight){//overflow
2126  firWeights[i] = firWeights[i]<0?-maxWeight:maxWeight;
2127  }
2128  }
2129  return firWeights;
2130 }
int i
Definition: DBlmapReader.cc:9
#define abs(x)
Definition: mlp_lapack.h:159
#define min(a, b)
Definition: mlp_lapack.h:161
double EcalSelectiveReadoutValidation::getL1aRate ( ) const
private

Gets L1A rate estimate.

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

Definition at line 704 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by endRun().

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

References nRuPerDcc_.

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

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

Referenced by anaDigi(), and analyzeEB().

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

Definition at line 2178 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by beginRun().

2178  {
2179  if(logSrpAlgoErrors_){
2181  if(!srpAlgoErrorLog_.good()){
2182  throw cms::Exception("Output")
2183  << "Failed to open the log file '"
2185  << "' for SRP algorithm result check.\n";
2186  }
2187  }
2188 
2191  if(!srApplicationErrorLog_.good()){
2192  throw cms::Exception("Output")
2193  << "Failed to open the log file '"
2195  << "' for Selective Readout decision application check.\n";
2196  }
2197  }
2198 }
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 255 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and analyzeEB().

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

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

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

Referenced by dccCh(), and setTtEtSums().

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

Referenced by anaDigi(), and analyzeEE().

265  {
266  return iX-1;
267  }
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 2040 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().

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

References availableHistList_, and create_public_lumi_plots::log.

Referenced by EcalSelectiveReadoutValidation().

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

1988  {
1989  ebRecHits_.read(event);
1990  eeRecHits_.read(event);
1991  ebDigis_.read(event);
1992  eeDigis_.read(event);
1995  ebSrFlags_.read(event);
1996  eeSrFlags_.read(event);
1997  ebComputedSrFlags_.read(event);
1998  eeComputedSrFlags_.read(event);
2001  tps_.read(event);
2002  fedRaw_.read(event);
2003 }
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:51
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 1780 of file EcalSelectiveReadoutValidation.cc.

References EcalTrigTowerConstituentsMap::towerOf(), and triggerTowerMap_.

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

1780  {
1781  return triggerTowerMap_->towerOf(xtalId);
1782 }
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 1785 of file EcalSelectiveReadoutValidation.cc.

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

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

References allHists_, availableHistList_, and histList_.

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

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

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

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

Definition at line 936 of file EcalSelectiveReadoutValidation.h.

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

Definition at line 932 of file EcalSelectiveReadoutValidation.h.

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

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

Definition at line 940 of file EcalSelectiveReadoutValidation.h.

940  {
941  return id.iphi();
942  }
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 2294 of file EcalSelectiveReadoutValidation.cc.

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

Referenced by analyze().

2294  {
2295  logErrForDccs_ = vector<bool>(nDccs_, false);
2296 
2298  it != ebSrFlags_->end();
2299  ++it){
2300 
2301  //cout << __FILE__ << ":" << __LINE__ << ": "
2302  // << EcalTrigTowerDetId(it->id()) << "\n";
2303 
2304  int iDcc = dccId(it->id()) - minDccId_;
2305  // cout << __FILE__ << ":" << __LINE__ << ": "
2306  // << it->id().rawId() << "-> DCC " << (iDcc+1) << "\n";
2307  logErrForDccs_.at(iDcc) = true;
2308  }
2309 
2311  it != eeSrFlags_->end();
2312  ++it){
2313  int iDcc = dccId(it->id()) - minDccId_;
2314 // cout << __FILE__ << ":" << __LINE__ << ": "
2315 // << it->id().rawId() << "-> DCC " << (iDcc+1) << "\n";
2316  logErrForDccs_.at(iDcc) = true;
2317  }
2318 
2319  stringstream buf;
2320  buf << "List of DCCs found in the first processed event: ";
2321  bool first = true;
2322  for(unsigned iDcc = 0; iDcc < nDccs_; ++iDcc){
2323  if(logErrForDccs_[iDcc]){
2324  buf << (first?"":", ") << (iDcc + minDccId_);
2325  first = false;
2326  }
2327  }
2328  buf << "\nOnly DCCs from this list will be considered for error logging\n";
2329  srpAlgoErrorLog_ << buf.str();
2330  srApplicationErrorLog_<< buf.str();
2331  LogInfo("EcalSrValid") << buf;
2332 }
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
std::vector< T >::const_iterator const_iterator
CollHandle< EBSrFlagCollection > ebSrFlags_
bool first
Definition: L1TdeRCT.cc:94
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 1796 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().

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

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

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

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

Referenced by analyze().

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

Definition at line 944 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and analyzeEE().

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

Definition at line 952 of file EcalSelectiveReadoutValidation.h.

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

Definition at line 948 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and analyzeEE().

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

Definition at line 956 of file EcalSelectiveReadoutValidation.h.

956  {
957  return id.iphi();
958  }

Member Data Documentation

bool EcalSelectiveReadoutValidation::allHists_
private

When true, every histogram is enabled.

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

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

bool EcalSelectiveReadoutValidation::collNotFoundWarn_
private

Switch for collection-not-found warning.

Definition at line 523 of file EcalSelectiveReadoutValidation.h.

DQMStore* EcalSelectiveReadoutValidation::dbe_
private

Histogramming interface.

Definition at line 517 of file EcalSelectiveReadoutValidation.h.

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

CollHandle<EBSrFlagCollection> EcalSelectiveReadoutValidation::ebComputedSrFlags_
private

Definition at line 551 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and readAllCollections().

CollHandle<EBDigiCollection> EcalSelectiveReadoutValidation::ebDigis_
private

The event product collections.

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

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

CollHandle<EBDigiCollection> EcalSelectiveReadoutValidation::ebNoZsDigis_
private

Definition at line 547 of file EcalSelectiveReadoutValidation.h.

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

CollHandle<RecHitCollection> EcalSelectiveReadoutValidation::ebRecHits_
private

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

Referenced by anaDigi(), and anaDigiInit().

CollHandle<std::vector<PCaloHit> > EcalSelectiveReadoutValidation::ebSimHits_
private

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

Referenced by anaDigi().

int EcalSelectiveReadoutValidation::ebZsThr_
private

ZS threshold in 1/4th ADC count for EB

Definition at line 730 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

CollHandle<EESrFlagCollection> EcalSelectiveReadoutValidation::eeComputedSrFlags_
private

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

Referenced by analyzeEE().

CollHandle<EEDigiCollection> EcalSelectiveReadoutValidation::eeNoZsDigis_
private

Definition at line 548 of file EcalSelectiveReadoutValidation.h.

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

CollHandle<RecHitCollection> EcalSelectiveReadoutValidation::eeRecHits_
private

Definition at line 557 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and readAllCollections().

bool EcalSelectiveReadoutValidation::eeRuActive_[nEndcaps][nEeX/scEdge][nEeY/scEdge]
private

Definition at line 810 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and anaDigiInit().

CollHandle<std::vector<PCaloHit> > EcalSelectiveReadoutValidation::eeSimHits_
private

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

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

const EcalElectronicsMapping* EcalSelectiveReadoutValidation::elecMap_
private

Ecal electronics/geometrical mapping.

Definition at line 713 of file EcalSelectiveReadoutValidation.h.

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

CollHandle<FEDRawDataCollection> EcalSelectiveReadoutValidation::fedRaw_
private

Definition at line 558 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 743 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 726 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 855 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 847 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and registerHist().

int EcalSelectiveReadoutValidation::ievt_
private

Event sequence number

Definition at line 821 of file EcalSelectiveReadoutValidation.h.

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

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

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

Referenced by analyzeDataVolume().

int64_t EcalSelectiveReadoutValidation::l1aOfTmax
private

Definition at line 567 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

int64_t EcalSelectiveReadoutValidation::l1aOfTmin
private

Definition at line 566 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

bool EcalSelectiveReadoutValidation::l1aRateErr
private

Definition at line 568 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 718 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 754 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 903 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 898 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and initAsciiFile().

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

Definition at line 458 of file EcalSelectiveReadoutValidation.h.

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

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

Definition at line 638 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meCompleteZSCnt_
private

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

Referenced by analyzeDataVolume(), and EcalSelectiveReadoutValidation().

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

Definition at line 637 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meDroppedFROCnt_
private

Definition at line 649 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

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

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

Referenced by EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbFullRoCnt_
private

Definition at line 623 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbHiZsFir_
private

Definition at line 627 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbIncompleteRUZsFir_
private

Definition at line 628 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meEbLiZsFir_
private

Definition at line 626 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbNoise_
private

Definition at line 597 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbNoZsRecVsSimE_
private

Definition at line 601 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbRecE_
private

Definition at line 595 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbRecEHitXtal_
private

Definition at line 599 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbRecVsSimE_
private

Definition at line 600 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbSimE_
private

Definition at line 598 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEB(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbZsErrCnt_
private

Definition at line 651 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEbZsErrType1Cnt_
private

Definition at line 654 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeEMean_
private

Definition at line 604 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeFixedPayload_
private

Definition at line 664 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeFullRoCnt_
private

Definition at line 624 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeHiZsFir_
private

Definition at line 631 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeLiZsFir_
private

Definition at line 630 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeNoise_
private

Definition at line 605 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeNoZsRecVsSimE_
private

Definition at line 609 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeRecE_
private

Definition at line 603 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeRecEHitXtal_
private

Definition at line 607 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeRecVsSimE_
private

Definition at line 608 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeSimE_
private

Definition at line 606 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeZsErrCnt_
private

Definition at line 652 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meEeZsErrType1Cnt_
private

Definition at line 655 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meFixedPayload_
private

Definition at line 665 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

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

Definition at line 618 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meFullRoCnt_
private

Definition at line 622 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and EcalSelectiveReadoutValidation().

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

Definition at line 636 of file EcalSelectiveReadoutValidation.h.

MonitorElement* EcalSelectiveReadoutValidation::meIncompleteFROCnt_
private

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

Referenced by EcalSelectiveReadoutValidation(), and endRun().

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

Definition at line 633 of file EcalSelectiveReadoutValidation.h.

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

Definition at line 632 of file EcalSelectiveReadoutValidation.h.

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

Definition at line 620 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meTpVsEtSum_
private

Definition at line 593 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

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

Definition at line 592 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeTP(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meTtfVsTp_
private

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

Referenced by analyze(), and EcalSelectiveReadoutValidation().

MonitorElement* EcalSelectiveReadoutValidation::meZsErrType1Cnt_
private

Definition at line 656 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 679 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 452 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 473 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 673 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and checkSrApplication().

int EcalSelectiveReadoutValidation::nEb_
private

ECAL barrel read channel count

Definition at line 758 of file EcalSelectiveReadoutValidation.h.

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

const int EcalSelectiveReadoutValidation::nEbDccs = 36
staticprivate

number of DCCs for EB

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

Referenced by analyzeEB().

int EcalSelectiveReadoutValidation::nEbFROCnt_
private

Counter of EB FRO-flagged RUs.

Definition at line 682 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEB().

int EcalSelectiveReadoutValidation::nEbHI_
private

ECAL barrel high interest read channel count

Definition at line 778 of file EcalSelectiveReadoutValidation.h.

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

int EcalSelectiveReadoutValidation::nEbLI_
private

ECAL barrel low interest read channel count

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

Referenced by analyzeEB().

const int EcalSelectiveReadoutValidation::nEbRus = 36*68
staticprivate

number of RUs for EB

Definition at line 467 of file EcalSelectiveReadoutValidation.h.

const int EcalSelectiveReadoutValidation::nEbTtEta = 34
staticprivate

Number of Trigger Towers in barrel along Eta.

Definition at line 500 of file EcalSelectiveReadoutValidation.h.

int EcalSelectiveReadoutValidation::nEbZsErrors_
private

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

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

Referenced by analyze(), and analyzeEB().

int EcalSelectiveReadoutValidation::nEe_
private

ECAL endcap read channel count

Definition at line 762 of file EcalSelectiveReadoutValidation.h.

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

const int EcalSelectiveReadoutValidation::nEeDccs = 18
staticprivate

number of DCCs for EE

Definition at line 464 of file EcalSelectiveReadoutValidation.h.

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

int EcalSelectiveReadoutValidation::nEeFROCnt_
private

Counter of EE FRO-flagged RUs.

Definition at line 685 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEE().

int EcalSelectiveReadoutValidation::nEeHI_
private

ECAL endcap high interest read channel count

Definition at line 770 of file EcalSelectiveReadoutValidation.h.

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

int EcalSelectiveReadoutValidation::nEeLI_
private

ECAL endcap low interest read channel count

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

const int EcalSelectiveReadoutValidation::nEeX = 100
staticprivate

EE crystal grid size along X.

Definition at line 485 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE().

const int EcalSelectiveReadoutValidation::nEeY = 100
staticprivate

EE crystal grid size along Y.

Definition at line 488 of file EcalSelectiveReadoutValidation.h.

Referenced by analyzeEE().

int EcalSelectiveReadoutValidation::nEeZsErrors_
private

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

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

Referenced by analyze(), and analyzeEE().

const int EcalSelectiveReadoutValidation::nEndcaps = 2
staticprivate

number of endcaps

Definition at line 476 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 790 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 803 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 676 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 786 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 799 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 509 of file EcalSelectiveReadoutValidation.h.

const int EcalSelectiveReadoutValidation::nOneEeTtEta = 11
staticprivate

Number of Trigger Towers in an endcap along Eta.

Definition at line 497 of file EcalSelectiveReadoutValidation.h.

Referenced by dccCh().

int EcalSelectiveReadoutValidation::nPerDcc_[nDccs_]
private

read-out ECAL channel count for each DCC:

Definition at line 782 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 817 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 795 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 503 of file EcalSelectiveReadoutValidation.h.

Referenced by setTtEtSums().

const int EcalSelectiveReadoutValidation::nTtPhi = 72
staticprivate

Number of Trigger Towers along Phi.

Definition at line 506 of file EcalSelectiveReadoutValidation.h.

Referenced by setTtEtSums().

std::string EcalSelectiveReadoutValidation::outputFile_
private

Output file for histograms.

Definition at line 520 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 511 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 494 of file EcalSelectiveReadoutValidation.h.

Referenced by anaDigi(), and superCrystalOf().

bool EcalSelectiveReadoutValidation::SkipInnerSC_
private

Permits to skip inner SC

Definition at line 842 of file EcalSelectiveReadoutValidation.h.

std::ofstream EcalSelectiveReadoutValidation::srApplicationErrorLog_
private

Output ascii file for unconsistency between Xtals and RU Flags.

Definition at line 537 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 531 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 534 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 527 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation(), and initAsciiFile().

int64_t EcalSelectiveReadoutValidation::tmax
private

For L1A rate estimate

Definition at line 564 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

int64_t EcalSelectiveReadoutValidation::tmin
private

Definition at line 565 of file EcalSelectiveReadoutValidation.h.

Referenced by getL1aRate(), and updateL1aRate().

bool EcalSelectiveReadoutValidation::tpInGeV_
private

Switch for uncompressing TP value

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

CollHandle<EcalTrigPrimDigiCollection> EcalSelectiveReadoutValidation::tps_
private

Definition at line 555 of file EcalSelectiveReadoutValidation.h.

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

const EcalTrigTowerConstituentsMap* EcalSelectiveReadoutValidation::triggerTowerMap_
private

ECAL trigger tower mapping

Definition at line 704 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 827 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 748 of file EcalSelectiveReadoutValidation.h.

Referenced by endRun().

bool EcalSelectiveReadoutValidation::verbose_
private

Verbosity switch.

Definition at line 514 of file EcalSelectiveReadoutValidation.h.

Referenced by EcalSelectiveReadoutValidation().

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

Weights for amplitude local reconstruction

Definition at line 722 of file EcalSelectiveReadoutValidation.h.

Referenced by frame2Energy().

bool EcalSelectiveReadoutValidation::withEbSimHit_
private

Indicates if EB sim hits are available

Definition at line 869 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEB().

bool EcalSelectiveReadoutValidation::withEeSimHit_
private

Indicates if EE sim hits are available

Definition at line 865 of file EcalSelectiveReadoutValidation.h.

Referenced by analyze(), and analyzeEE().

std::ofstream EcalSelectiveReadoutValidation::zsErrorLog_
private

File to log ZS and other errors.

Definition at line 540 of file EcalSelectiveReadoutValidation.h.