Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:35

0001 #include "SimCalorimetry/HcalZeroSuppressionProducers/interface/HcalZeroSuppressionAlgo.h"
0002 
0003 HcalZeroSuppressionAlgo::HcalZeroSuppressionAlgo(bool mp) : m_markAndPass(mp) { m_dbService = nullptr; }
0004 
0005 void HcalZeroSuppressionAlgo::suppress(const HBHEDigiCollection &input, HBHEDigiCollection &output) {
0006   HBHEDigiCollection::const_iterator i;
0007 
0008   for (i = input.begin(); i != input.end(); ++i) {
0009     if (shouldKeep((*i))) {
0010       if (!m_markAndPass) {
0011         output.push_back(*i);
0012       } else {
0013         HBHEDataFrame df(*i);
0014         df.setZSInfo(true, false);
0015         output.push_back(df);
0016       }
0017     } else if (m_markAndPass) {
0018       HBHEDataFrame df(*i);
0019       df.setZSInfo(true, true);
0020       output.push_back(df);
0021     }
0022   }
0023 }
0024 
0025 void HcalZeroSuppressionAlgo::suppress(const HFDigiCollection &input, HFDigiCollection &output) {
0026   HFDigiCollection::const_iterator i;
0027 
0028   for (i = input.begin(); i != input.end(); ++i) {
0029     if (shouldKeep((*i))) {
0030       if (!m_markAndPass) {
0031         output.push_back(*i);
0032       } else {
0033         HFDataFrame df(*i);
0034         df.setZSInfo(true, false);
0035         output.push_back(df);
0036       }
0037     } else if (m_markAndPass) {
0038       HFDataFrame df(*i);
0039       df.setZSInfo(true, true);
0040       output.push_back(df);
0041     }
0042   }
0043 }
0044 
0045 void HcalZeroSuppressionAlgo::suppress(const HODigiCollection &input, HODigiCollection &output) {
0046   HODigiCollection::const_iterator i;
0047 
0048   for (i = input.begin(); i != input.end(); ++i) {
0049     if (shouldKeep((*i))) {
0050       if (!m_markAndPass) {
0051         output.push_back(*i);
0052       } else {
0053         HODataFrame df(*i);
0054         df.setZSInfo(true, false);
0055         output.push_back(df);
0056       }
0057     } else if (m_markAndPass) {
0058       HODataFrame df(*i);
0059       df.setZSInfo(true, true);
0060       output.push_back(df);
0061     }
0062   }
0063 }
0064 
0065 void HcalZeroSuppressionAlgo::suppress(const QIE10DigiCollection &input, QIE10DigiCollection &output) {
0066   for (QIE10DigiCollection::const_iterator i = input.begin(); i != input.end(); ++i) {
0067     QIE10DataFrame df(*i);
0068     if (shouldKeep(df)) {
0069       if (!m_markAndPass) {
0070         output.push_back(df);
0071       } else {
0072         df.setZSInfo(false);
0073         output.push_back(df);
0074       }
0075     } else if (m_markAndPass) {
0076       df.setZSInfo(true);
0077       output.push_back(df);
0078     }
0079   }
0080 }
0081 
0082 void HcalZeroSuppressionAlgo::suppress(const QIE11DigiCollection &input, QIE11DigiCollection &output) {
0083   for (QIE11DigiCollection::const_iterator i = input.begin(); i != input.end(); ++i) {
0084     QIE11DataFrame df(*i);
0085     if (shouldKeep(df)) {
0086       if (!m_markAndPass) {
0087         output.push_back(df);
0088       } else {
0089         df.setZSInfo(false);
0090         output.push_back(df);
0091       }
0092     } else if (m_markAndPass) {
0093       df.setZSInfo(true);
0094       output.push_back(df);
0095     }
0096   }
0097 }