File indexing completed on 2024-04-06 12:10:22
0001 #ifndef EventFilter_CSCRawToDigi_CSCDigiToRawAccept_h
0002 #define EventFilter_CSCRawToDigi_CSCDigiToRawAccept_h
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h"
0012 #include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h"
0013 #include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerCollection.h"
0014 #include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigiCollection.h"
0015
0016 namespace CSCDigiToRawAccept {
0017
0018
0019 CSCDetId chamberID(const CSCDetId& cscDetId);
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 template <typename LCTCollection>
0030 bool accept(const CSCDetId& cscId, const LCTCollection& lcts, int bxMin, int bxMax, int nominalBX) {
0031 if (bxMin == -999)
0032 return true;
0033 CSCDetId chamberId = chamberID(cscId);
0034 typename LCTCollection::Range lctRange = lcts.get(chamberId);
0035 bool result = false;
0036 for (typename LCTCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) {
0037 int bx = lctItr->getBX() - nominalBX;
0038 if (bx >= bxMin && bx <= bxMax) {
0039 result = true;
0040 break;
0041 }
0042 }
0043 return result;
0044 }
0045
0046
0047 bool accept(const CSCDetId& cscId, const CSCCLCTPreTriggerCollection& lcts, int bxMin, int bxMax, int nominalBX);
0048
0049
0050 bool accept(const CSCDetId& cscId,
0051 const CSCCLCTPreTriggerDigiCollection& lcts,
0052 int bxMin,
0053 int bxMax,
0054 int nominalBX,
0055 std::vector<bool>& preTriggerInCFEB);
0056 };
0057
0058 #endif