46 edm::LogWarning(
"EcalSelectiveReadout") <<
"Parameter configFromCondDB of EcalSelectiveReadout module not found. "
47 "Selective readout configuration will be read from python file.";
103 auto_ptr<EBDigiCollection> selectedEBDigis;
104 auto_ptr<EEDigiCollection> selectedEEDigis;
105 auto_ptr<EBSrFlagCollection> ebSrFlags;
106 auto_ptr<EESrFlagCollection> eeSrFlags;
131 suppressor_->run(eventSetup, *trigPrims, *ebDigis, *eeDigis,
132 selectedEBDigis.get(), selectedEEDigis.get(),
133 ebSrFlags.get(), eeSrFlags.get());
137 ofstream ttfFile(
"TTF.txt", (iEvent==1?
ios::trunc:ios::app));
139 iEvent==1?
true:
false);
141 ofstream srfFile(
"SRF.txt", (iEvent==1?
ios::trunc:ios::app));
143 suppressor_->getEcalSelectiveReadout()->printHeader(srfFile);
145 srfFile <<
"# Event " << iEvent <<
"\n";
146 suppressor_->getEcalSelectiveReadout()->print(srfFile);
149 ofstream afFile(
"AF.txt", (iEvent==1?
ios::trunc:ios::app));
151 iEvent==1?
true:
false);
177 static bool firstCall=
true;
193 static bool firstCall =
true;
258 const char tccFlagMarker[] = {
'x',
'.',
'S',
'?',
'C',
'E',
'E',
'E',
'E'};
265 os <<
"# TCC flag map\n#\n"
266 "# +-->Phi " << tccFlagMarker[0+1] <<
": 000 (low interest)\n"
267 "# | " << tccFlagMarker[1+1] <<
": 001 (mid interest)\n"
268 "# | " << tccFlagMarker[2+1] <<
": 010 (not valid)\n"
269 "# V Eta " << tccFlagMarker[3+1] <<
": 011 (high interest)\n"
270 "# " << tccFlagMarker[4+1] <<
": 1xx forced readout (Hw error)\n"
274 vector<vector<int> > ttf(nEta, vector<int>(nPhi, -1));
276 it != tp.
end(); ++it){
278 if(trigPrim.
size()>0){
279 int iEta = trigPrim.
id().
ieta();
280 int iEta0 = iEta<0?iEta+nEta/2:iEta+nEta/2-1;
281 int iPhi0 = trigPrim.
id().
iphi() - 1;
282 ttf[iEta0][iPhi0] = trigPrim.
ttFlag();
285 for(
int iEta=0; iEta<nEta; ++iEta){
286 for(
int iPhi=0; iPhi<nPhi; ++iPhi){
287 os << tccFlagMarker[ttf[iEta][iPhi]+1];
297 static bool warnWeightCnt =
true;
298 if((
int)weights.size() > nFIRTaps && warnWeightCnt){
299 edm::LogWarning(
"Configuration") <<
"The list of DCC zero suppression FIR "
300 "weights given in parameter dccNormalizedWeights is longer "
301 "than the expected depth of the FIR filter :(" << nFIRTaps <<
"). "
302 "The last weights will be discarded.";
303 warnWeightCnt =
false;
306 if(weights.size()>0){
308 double maxWeight = weights[iMaxWeight];
310 for(
unsigned i=0;
i<weights.size(); ++
i){
311 if(weights[
i]>maxWeight){
313 maxWeight = weights[iMaxWeight];
325 if(rc && maxWeightBin!=binOfMax){
327 <<
"The maximum weight of DCC zero suppression FIR filter is not "
328 "applied to the expected maximum sample(" << binOfMax
329 << (binOfMax==1?
"st":(binOfMax==2?
"nd":(binOfMax==3?
"rd":
"th")))
330 <<
" time sample). This may indicate faulty 'dccNormalizedWeights' "
331 "or 'ecalDccZs1sSample' parameters.";
339 int& binOfMax)
const{
344 string bofm(
"binOfMaximum");
345 if(
find(ebDigiParamList.begin(), ebDigiParamList.end(), bofm)
346 != ebDigiParamList.end()){
361 const char srpFlagMarker[] = {
'.',
'z',
'Z',
'F',
'4',
'5',
'6',
'7'};
365 const char* date = ctime(&t);
366 os <<
"#SRP flag map\n#\n"
367 "# Generatied on: " << date <<
"\n#\n"
368 "# +-->Phi/Y " << srpFlagMarker[0] <<
": suppressed\n"
369 "# | " << srpFlagMarker[1] <<
": ZS 1\n"
370 "# | " << srpFlagMarker[2] <<
": ZS 2\n"
371 "# V Eta/X " << srpFlagMarker[3] <<
": full readout\n"
406 os <<
"# Event " << iEvent <<
"\n";
414 for(
size_t i=0;
i <
sizeof(eeSrf)/
sizeof(
int); ((
int*)eeSrf)[
i++] = -1){};
416 it != eeSrFlags.
end(); ++it){
418 int iZ0 = flag.
id().
zside()>0?1:0;
419 int iX0 = flag.
id().
ix()-1;
420 int iY0 = flag.
id().
iy()-1;
421 assert(iZ0>=0 && iZ0<nEndcaps);
422 assert(iX0>=0 && iX0<nScX);
423 assert(iY0>=0 && iY0<nScY);
424 eeSrf[iZ0][iX0][iY0] = flag.
value();
426 const int nEbTtEta = 34;
427 const int nEeTtEta = 11;
428 const int nTtEta = nEeTtEta*2+nEbTtEta;
429 const int nTtPhi = 72;
430 int ebSrf[nEbTtEta][nTtPhi];
431 for(
size_t i=0;
i<
sizeof(ebSrf)/
sizeof(
int); ((
int*)ebSrf)[
i++] = -1){};
433 it != ebSrFlags.
end(); ++it){
436 int iEta = flag.
id().
ieta();
437 int iEta0 = iEta + nTtEta/2 - (iEta>=0?1:0);
438 int iEbEta0 = iEta0 - nEeTtEta;
439 int iPhi0 = flag.
id().
iphi() - 1;
440 assert(iEbEta0>=0 && iEbEta0<nEbTtEta);
441 assert(iPhi0>=0 && iPhi0<nTtPhi);
449 ebSrf[iEbEta0][iPhi0] = flag.
value();
456 for(
int iX0=0; iX0<nScX; ++iX0){
457 for(
int iY0=0; iY0<nScY; ++iY0){
458 int srFlag = eeSrf[0][iX0][iY0];
460 && srFlag<(
int)(
sizeof(srpFlagMarker)/
sizeof(srpFlagMarker[0])));
461 os << (srFlag==-1?
' ':srpFlagMarker[srFlag]);
470 for(
int iPhi0 = 0; iPhi0 < nTtPhi; ++iPhi0){
471 int srFlag = ebSrf[iEta0][iPhi0];
473 && srFlag<(
int)(
sizeof(srpFlagMarker)/
sizeof(srpFlagMarker[0])));
474 os << (srFlag==-1?
'?':srpFlagMarker[srFlag]);
480 for(
int iX0=0; iX0<nScX; ++iX0){
481 for(
int iY0=0; iY0<nScY; ++iY0){
482 int srFlag = eeSrf[1][iX0][iY0];
484 && srFlag<(
int)(
sizeof(srpFlagMarker)/
sizeof(srpFlagMarker[0])));
485 os << (srFlag==-1?
' ':srpFlagMarker[srFlag]);
496 throw cms::Exception(
"Configuration") <<
"Selective readout emulator, EcalSelectiveReadout, supports only single set of ZS weights. "
511 throw cms::Exception(
"Configuration") <<
"Inconsistency between number of weigth sets ("
513 <<
"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_