forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
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 cms-sw#17692 from nancymarinelli/TP_PhaseII_V1
Update the dataformat for the TP per crystal. It now follows what pre…
- Loading branch information
Showing
14 changed files
with
301 additions
and
260 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
56 changes: 56 additions & 0 deletions
56
DataFormats/EcalDigi/interface/EcalEBTriggerPrimitiveSample.h
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,56 @@ | ||
#ifndef ECALEBTRIGGERPRIMITIVESAMPLE_H | ||
#define ECALEBTRIGGERPRIMITIVESAMPLE_H 1 | ||
|
||
#include <boost/cstdint.hpp> | ||
#include <ostream> | ||
|
||
|
||
|
||
/** \class EcalEBTriggerPrimitiveSample | ||
\author N. Marinelli - Univ of Notre Dame | ||
*/ | ||
|
||
class EcalEBTriggerPrimitiveSample { | ||
public: | ||
EcalEBTriggerPrimitiveSample(); | ||
EcalEBTriggerPrimitiveSample(uint16_t data); | ||
EcalEBTriggerPrimitiveSample(int encodedEt); | ||
EcalEBTriggerPrimitiveSample(int encodedEt, bool isASpike); | ||
EcalEBTriggerPrimitiveSample(int encodedEt, bool isASpike, int timing); | ||
|
||
///Set data | ||
void setValue(uint16_t data){ theSample = data;} | ||
// The sample is a 16 bit word defined as: | ||
// | ||
// o o o o o o o o o o o o o o o o | ||
// |________| |____________________| | ||
// ~60ps res spike Et | ||
// time info flag | ||
// | ||
|
||
|
||
/// get the raw word | ||
uint16_t raw() const { return theSample; } | ||
|
||
/// get the encoded Et (10 bits) | ||
int encodedEt() const { return theSample&0x3FF; } | ||
|
||
bool l1aSpike() const { return (theSample&0x400)!=0; } | ||
|
||
int time() const { return theSample>>11; } | ||
|
||
/// for streaming | ||
uint16_t operator()() { return theSample; } | ||
|
||
private: | ||
uint16_t theSample; | ||
|
||
}; | ||
|
||
std::ostream& operator<<(std::ostream& s, const EcalEBTriggerPrimitiveSample& samp); | ||
|
||
|
||
|
||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "DataFormats/EcalDigi/interface/EcalEBTriggerPrimitiveSample.h" | ||
|
||
|
||
|
||
EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample() : theSample(0) { } | ||
EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample(uint16_t data) : theSample(data) { } | ||
|
||
EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample(int encodedEt, bool isASpike) { | ||
theSample=(encodedEt&0x3FF)| ((isASpike)?(0x400):(0)); | ||
} | ||
|
||
|
||
EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample(int encodedEt, bool isASpike, int timing) { | ||
theSample=(encodedEt&0x3FF)| ((isASpike)?(0x400):(0)) | timing<<11; | ||
} | ||
|
||
|
||
EcalEBTriggerPrimitiveSample::EcalEBTriggerPrimitiveSample(int encodedEt) { | ||
theSample=encodedEt&0x3FF; | ||
} | ||
|
||
|
||
|
||
std::ostream& operator<<(std::ostream& s, const EcalEBTriggerPrimitiveSample& samp) { | ||
return s << "ET=" << samp.encodedEt() << ", isASpike=" << samp.l1aSpike()<< " timing= " << samp.time() ; | ||
|
||
} | ||
|
||
|
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
Oops, something went wrong.