Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:22

0001 #ifndef EventFilter_CSCRawToDigi_CSCDigiToRawAccept_h
0002 #define EventFilter_CSCRawToDigi_CSCDigiToRawAccept_h
0003 
0004 /** \class CSCDigiToRawAccept
0005  *
0006  * Static class with conditions to accept CSC digis in the Digi-to-Raw step
0007  *
0008  *  \author Sven Dildick - Rice
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   // takes layer ID, converts to chamber ID, switching ME1A to ME11
0019   CSCDetId chamberID(const CSCDetId& cscDetId);
0020 
0021   /* Was there a trigger primitive in the BX range between bxMin and bxMax?
0022      The nominalBX argument is 3 for ALCTs and 7 for CLCTs. This is subtracted
0023      from the object BX before we check if it is in the BX range.
0024 
0025      Triggers in ME1/1 should always be assigned with ring number equal to 1.
0026      Distinguishing CLCTs in ME1/a and ME1/b is done with the CLCT half-strip,
0027      or CLCT CFEB.
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   // older implementation for CLCT pretrigger objects that only have BX information
0047   bool accept(const CSCDetId& cscId, const CSCCLCTPreTriggerCollection& lcts, int bxMin, int bxMax, int nominalBX);
0048 
0049   // newer implementation for CLCT pretrigger objects that have BX and CFEB information
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 };  // namespace CSCDigiToRawAccept
0057 
0058 #endif