Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34783 from dildick/CMSSW_12_0_X-pack-by-cfeb
New option in CSC DigiToRaw to pack strip digis by CFEB in each chamber.
- Loading branch information
Showing
10 changed files
with
813 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#ifndef EventFilter_CSCRawToDigi_CSCDigiToRawAccept_h | ||
#define EventFilter_CSCRawToDigi_CSCDigiToRawAccept_h | ||
|
||
/** \class CSCDigiToRawAccept | ||
* | ||
* Static class with conditions to accept CSC digis in the Digi-to-Raw step | ||
* | ||
* \author Sven Dildick - Rice | ||
*/ | ||
|
||
#include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h" | ||
#include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h" | ||
#include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerCollection.h" | ||
#include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigiCollection.h" | ||
|
||
namespace CSCDigiToRawAccept { | ||
|
||
// takes layer ID, converts to chamber ID, switching ME1A to ME11 | ||
CSCDetId chamberID(const CSCDetId& cscDetId); | ||
|
||
/* Was there a trigger primitive in the BX range between bxMin and bxMax? | ||
The nominalBX argument is 3 for ALCTs and 7 for CLCTs. This is subtracted | ||
from the object BX before we check if it is in the BX range. | ||
Triggers in ME1/1 should always be assigned with ring number equal to 1. | ||
Distinguishing CLCTs in ME1/a and ME1/b is done with the CLCT half-strip, | ||
or CLCT CFEB. | ||
*/ | ||
template <typename LCTCollection> | ||
bool accept(const CSCDetId& cscId, const LCTCollection& lcts, int bxMin, int bxMax, int nominalBX) { | ||
if (bxMin == -999) | ||
return true; | ||
CSCDetId chamberId = chamberID(cscId); | ||
typename LCTCollection::Range lctRange = lcts.get(chamberId); | ||
bool result = false; | ||
for (typename LCTCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { | ||
int bx = lctItr->getBX() - nominalBX; | ||
if (bx >= bxMin && bx <= bxMax) { | ||
result = true; | ||
break; | ||
} | ||
} | ||
return result; | ||
} | ||
|
||
// older implementation for CLCT pretrigger objects that only have BX information | ||
bool accept(const CSCDetId& cscId, const CSCCLCTPreTriggerCollection& lcts, int bxMin, int bxMax, int nominalBX); | ||
|
||
// newer implementation for CLCT pretrigger objects that have BX and CFEB information | ||
bool accept(const CSCDetId& cscId, | ||
const CSCCLCTPreTriggerDigiCollection& lcts, | ||
int bxMin, | ||
int bxMax, | ||
int nominalBX, | ||
std::vector<bool>& preTriggerInCFEB); | ||
}; // namespace CSCDigiToRawAccept | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include "DataFormats/CSCDigi/interface/CSCConstants.h" | ||
#include "EventFilter/CSCRawToDigi/interface/CSCDigiToRawAccept.h" | ||
|
||
CSCDetId CSCDigiToRawAccept::chamberID(const CSCDetId& cscDetId) { | ||
CSCDetId chamberId = cscDetId.chamberId(); | ||
if (chamberId.ring() == 4) { | ||
chamberId = CSCDetId(chamberId.endcap(), chamberId.station(), 1, chamberId.chamber(), 0); | ||
} | ||
return chamberId; | ||
} | ||
|
||
// older function for pretriggers BX objects | ||
bool CSCDigiToRawAccept::accept( | ||
const CSCDetId& cscId, const CSCCLCTPreTriggerCollection& lcts, int bxMin, int bxMax, int nominalBX) { | ||
if (bxMin == -999) | ||
return true; | ||
CSCDetId chamberId = chamberID(cscId); | ||
CSCCLCTPreTriggerCollection::Range lctRange = lcts.get(chamberId); | ||
bool result = false; | ||
for (CSCCLCTPreTriggerCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { | ||
int bx = *lctItr - nominalBX; | ||
if (bx >= bxMin && bx <= bxMax) { | ||
result = true; | ||
break; | ||
} | ||
} | ||
return result; | ||
} | ||
|
||
bool CSCDigiToRawAccept::accept(const CSCDetId& cscId, | ||
const CSCCLCTPreTriggerDigiCollection& lcts, | ||
int bxMin, | ||
int bxMax, | ||
int nominalBX, | ||
std::vector<bool>& preTriggerInCFEB) { | ||
if (bxMin == -999) | ||
return true; | ||
|
||
bool atLeastOnePreTrigger = false; | ||
|
||
CSCDetId chamberId = chamberID(cscId); | ||
CSCCLCTPreTriggerDigiCollection::Range lctRange = lcts.get(chamberId); | ||
for (CSCCLCTPreTriggerDigiCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { | ||
int bx = lctItr->getBX() - nominalBX; | ||
if (bx >= bxMin && bx <= bxMax) { | ||
atLeastOnePreTrigger = true; | ||
// save the location of all pretriggers | ||
preTriggerInCFEB[lctItr->getCFEB()] = true; | ||
} | ||
} | ||
return atLeastOnePreTrigger; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<bin file="cscRawToDigiTest.cpp"> | ||
<use name="EventFilter/CSCRawToDigi"/> | ||
</bin> | ||
<library file="CSCPackerUnpackerUnitTest.cc" name="CSCRawToDigiTest"> | ||
<use name="EventFilter/CSCRawToDigi"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="DataFormats/CSCDigi"/> | ||
<flags EDM_PLUGIN="1"/> | ||
</library> |
Oops, something went wrong.