46 edm::LogWarning(
"EcalSelectiveReadout") <<
"Parameter configFromCondDB of EcalSelectiveReadout module not found. "
47 "Selective readout configuration will be read from python file.";
101 auto_ptr<EBDigiCollection> selectedEBDigis;
102 auto_ptr<EEDigiCollection> selectedEEDigis;
103 auto_ptr<EBSrFlagCollection> ebSrFlags;
104 auto_ptr<EESrFlagCollection> eeSrFlags;
129 suppressor_->run(eventSetup, *trigPrims, *ebDigis, *eeDigis,
130 selectedEBDigis.get(), selectedEEDigis.get(),
131 ebSrFlags.get(), eeSrFlags.get());
135 ofstream ttfFile(
"TTF.txt", (iEvent==1?ios::trunc:ios::app));
137 iEvent==1?
true:
false);
139 ofstream srfFile(
"SRF.txt", (iEvent==1?ios::trunc:ios::app));
141 suppressor_->getEcalSelectiveReadout()->printHeader(srfFile);
143 srfFile <<
"# Event " << iEvent <<
"\n";
144 suppressor_->getEcalSelectiveReadout()->print(srfFile);
147 ofstream afFile(
"AF.txt", (iEvent==1?ios::trunc:ios::app));
149 iEvent==1?
true:
false);
175 static bool firstCall=
true;
191 static bool firstCall =
true;
256 const char tccFlagMarker[] = {
'x',
'.',
'S',
'?',
'C',
'E',
'E',
'E',
'E'};
263 os <<
"# TCC flag map\n#\n"
264 "# +-->Phi " << tccFlagMarker[0+1] <<
": 000 (low interest)\n"
265 "# | " << tccFlagMarker[1+1] <<
": 001 (mid interest)\n"
266 "# | " << tccFlagMarker[2+1] <<
": 010 (not valid)\n"
267 "# V Eta " << tccFlagMarker[3+1] <<
": 011 (high interest)\n"
268 "# " << tccFlagMarker[4+1] <<
": 1xx forced readout (Hw error)\n"
272 vector<vector<int> > ttf(nEta, vector<int>(nPhi, -1));
274 it != tp.
end(); ++it){
276 if(trigPrim.
size()>0){
277 int iEta = trigPrim.
id().
ieta();
278 int iEta0 = iEta<0?iEta+nEta/2:iEta+nEta/2-1;
279 int iPhi0 = trigPrim.
id().
iphi() - 1;
280 ttf[iEta0][iPhi0] = trigPrim.
ttFlag();
283 for(
int iEta=0; iEta<
nEta; ++iEta){
284 for(
int iPhi=0; iPhi<
nPhi; ++iPhi){
285 os << tccFlagMarker[ttf[iEta][iPhi]+1];
295 static bool warnWeightCnt =
true;
296 if((
int)weights.size() > nFIRTaps && warnWeightCnt){
297 edm::LogWarning(
"Configuration") <<
"The list of DCC zero suppression FIR "
298 "weights given in parameter dccNormalizedWeights is longer "
299 "than the expected depth of the FIR filter :(" << nFIRTaps <<
"). "
300 "The last weights will be discarded.";
301 warnWeightCnt =
false;
304 if(weights.size()>0){
306 double maxWeight = weights[iMaxWeight];
308 for(
unsigned i=0;
i<weights.size(); ++
i){
309 if(weights[
i]>maxWeight){
311 maxWeight = weights[iMaxWeight];
323 if(rc && maxWeightBin!=binOfMax){
325 <<
"The maximum weight of DCC zero suppression FIR filter is not "
326 "applied to the expected maximum sample(" << binOfMax
327 << (binOfMax==1?
"st":(binOfMax==2?
"nd":(binOfMax==3?
"rd":
"th")))
328 <<
" time sample). This may indicate faulty 'dccNormalizedWeights' "
329 "or 'ecalDccZs1sSample' parameters.";
337 int& binOfMax)
const{
342 string bofm(
"binOfMaximum");
343 if(
find(ebDigiParamList.begin(), ebDigiParamList.end(), bofm)
344 != ebDigiParamList.end()){
359 const char srpFlagMarker[] = {
'.',
'z',
'Z',
'F',
'4',
'5',
'6',
'7'};
363 const char*
date = ctime(&t);
364 os <<
"#SRP flag map\n#\n"
365 "# Generatied on: " << date <<
"\n#\n"
366 "# +-->Phi/Y " << srpFlagMarker[0] <<
": suppressed\n"
367 "# | " << srpFlagMarker[1] <<
": ZS 1\n"
368 "# | " << srpFlagMarker[2] <<
": ZS 2\n"
369 "# V Eta/X " << srpFlagMarker[3] <<
": full readout\n"
404 os <<
"# Event " << iEvent <<
"\n";
412 for(
size_t i=0;
i <
sizeof(eeSrf)/
sizeof(
int); ((
int*)eeSrf)[
i++] = -1){};
414 it != eeSrFlags.
end(); ++it){
416 int iZ0 = flag.
id().
zside()>0?1:0;
417 int iX0 = flag.
id().
ix()-1;
418 int iY0 = flag.
id().
iy()-1;
419 assert(iZ0>=0 && iZ0<nEndcaps);
420 assert(iX0>=0 && iX0<nScX);
421 assert(iY0>=0 && iY0<nScY);
422 eeSrf[iZ0][iX0][iY0] = flag.
value();
424 const int nEbTtEta = 34;
425 const int nEeTtEta = 11;
426 const int nTtEta = nEeTtEta*2+nEbTtEta;
427 const int nTtPhi = 72;
428 int ebSrf[nEbTtEta][nTtPhi];
429 for(
size_t i=0;
i<
sizeof(ebSrf)/
sizeof(
int); ((
int*)ebSrf)[
i++] = -1){};
431 it != ebSrFlags.
end(); ++it){
434 int iEta = flag.
id().
ieta();
435 int iEta0 = iEta + nTtEta/2 - (iEta>=0?1:0);
436 int iEbEta0 = iEta0 - nEeTtEta;
437 int iPhi0 = flag.
id().
iphi() - 1;
438 assert(iEbEta0>=0 && iEbEta0<nEbTtEta);
439 assert(iPhi0>=0 && iPhi0<nTtPhi);
447 ebSrf[iEbEta0][iPhi0] = flag.
value();
454 for(
int iX0=0; iX0<nScX; ++iX0){
455 for(
int iY0=0; iY0<nScY; ++iY0){
456 int srFlag = eeSrf[0][iX0][iY0];
458 && srFlag<(
int)(
sizeof(srpFlagMarker)/
sizeof(srpFlagMarker[0])));
459 os << (srFlag==-1?
' ':srpFlagMarker[srFlag]);
468 for(
int iPhi0 = 0; iPhi0 < nTtPhi; ++iPhi0){
469 int srFlag = ebSrf[iEta0][iPhi0];
471 && srFlag<(
int)(
sizeof(srpFlagMarker)/
sizeof(srpFlagMarker[0])));
472 os << (srFlag==-1?
'?':srpFlagMarker[srFlag]);
478 for(
int iX0=0; iX0<nScX; ++iX0){
479 for(
int iY0=0; iY0<nScY; ++iY0){
480 int srFlag = eeSrf[1][iX0][iY0];
482 && srFlag<(
int)(
sizeof(srpFlagMarker)/
sizeof(srpFlagMarker[0])));
483 os << (srFlag==-1?
' ':srpFlagMarker[srFlag]);
494 throw cms::Exception(
"Configuration") <<
"Selective readout emulator, EcalSelectiveReadout, supports only single set of ZS weights. "
509 throw cms::Exception(
"Configuration") <<
"Inconsistency between number of weigth sets ("
511 <<
"number of ecalDccZs1Sample values ("
T getParameter(std::string const &) const
const CaloGeometry * theGeometry
T getUntrackedParameter(std::string const &, T const &) const
std::string trigPrimProducer_
std::string eedigiCollection_
std::string ebSRPdigiCollection_
const EEDigiCollection * getEEDigis(edm::Event &event) const
void checkTriggerMap(const edm::EventSetup &eventSetup)
void checkGeometry(const edm::EventSetup &eventSetup)
ParameterSet const & getParameterSet(ParameterSetID const &id)
std::vector< T >::const_iterator const_iterator
std::string eeSrFlagCollection_
std::vector< std::vector< float > > dccNormalizedWeights_
const char tccFlagMarker[]
bool getBinOfMax(const edm::Event &evt, const edm::ProductID &noZsDigiId, int &binOfMax) const
const EcalSRSettings * settings_
void printTTFlags(const EcalTrigPrimDigiCollection &tp, std::ostream &os) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int ieta() const
get the tower ieta
virtual void produce(edm::Event &event, const edm::EventSetup &eventSetup)
ParameterSetID psetID() const
edm::ParameterSet params_
void checkElecMap(const edm::EventSetup &eventSetup)
edm::SortedCollection< EBSrFlag > EBSrFlagCollection
const EcalTrigTowerConstituentsMap * theTriggerTowerMap
edm::SortedCollection< EESrFlag > EESrFlagCollection
std::vector< int > ecalDccZs1stSample_
std::string trigPrimCollection_
const EcalElectronicsMapping * theElecMap
std::vector< std::string > getParameterNames() const
std::auto_ptr< EcalSelectiveReadoutSuppressor > suppressor_
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 checkWeights(const edm::Event &evt, const edm::ProductID &noZSDigiId) const
static int getFIRTapCount()
const_iterator end() const
virtual ~EcalSelectiveReadoutProducer()
int iphi() const
get the tower iphi
static const int nEndcaps
const EBDigiCollection * getEBDigis(edm::Event &event) const
const EcalTrigPrimDigiCollection * getTrigPrims(edm::Event &event) const
const EcalTrigTowerDetId & id() const
const EcalScDetId & id() const
T const * product() const
static const size_t nTriggerTowersInEta
static const size_t nTriggerTowersInPhi
T const * product() const
const EcalTrigTowerDetId & id() const
std::string digiProducer_
std::string ebSrFlagCollection_
static void printSrFlags(std::ostream &os, const EBSrFlagCollection &ebSrFlags, const EESrFlagCollection &eeSrFlags, int iEvent=-1, bool withHeader=true)
EcalSelectiveReadoutProducer(const edm::ParameterSet ¶ms)
Provenance getProvenance(BranchID const &theID) const
static void checkValidity(const EcalSRSettings &settings)
int ttFlag() const
get the Trigger tower Flag of interesting sample
std::string eeSRPdigiCollection_
const_iterator begin() const
const char srpFlagMarker[]
std::string ebdigiCollection_
std::auto_ptr< EcalSRSettings > settingsFromFile_