-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ecal phase2 new digitization 11 2 x #31726
Merged
cmsbuild
merged 30 commits into
cms-sw:master
from
dariosol:EcalPhase2NewDigitization_11_2_X
Nov 25, 2020
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
09ee5b4
Move EcalDigiSimRecoPhase2 from 11_1_X to 11_2_X
dariosol 921a4c7
Add code formats
dariosol 47d5b27
Modify from Era_Phase2C10_Ecal_Devel to Era_Phase2C11_Ecal_Devel
dariosol 26b327a
fix typo in Eras.py
dariosol ac272c7
fix eras with last version
dariosol 09dee48
fix eras
dariosol b797ece
Take pulse shape from database
dariosol 1c6eadc
Remove conddb local file call
dariosol b3bab5b
put back timeDependent parameter
dariosol edb236f
Checks on Ecal Lite DTU Coder
dariosol f24b107
Remove ES parameter from ecal Digitizer Phase2
dariosol a2b2a57
change python script for ecal digi phase2
dariosol 9f47a87
Remove pulseshape from repo
dariosol 495c566
Remove phase 2 digis from premix
dariosol da7bc0e
code formats
dariosol d63c30b
add ecal devel special workflow
kpedro88 7f23644
temporarily remove trigger and downstream steps for ecal devel wf
kpedro88 7d7fa8d
remove unneeded Era
kpedro88 2b887b5
Merge pull request #1 from kpedro88/EcalPhase2NewDigitization_11_2_X_…
dariosol 65e5511
Move clone in ecalDigis_cfi
dariosol eececcb
Changed Digi definition in EBDigiCollectionPh2
dariosol 571f1cb
Take values from records in correct way in EcalDigiProducer_Ph2
dariosol 37c3122
Removed useless include in EBDataFrame
dariosol 6b8e764
fix typo
dariosol 4cc80a8
Add code formats
dariosol f9aa038
Add dependency of EBDetID in EcalDataFrame_Ph2
dariosol 6bf7919
Removed useless comments
dariosol 58a8a67
Add token to checkgeometry
dariosol f757774
Removed dependency already in the header
dariosol 00980d2
Moved EcalConstants from CondFormats to DataFormats
dariosol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#include "CalibFormats/CaloObjects/interface/CaloTSamples.icc" | ||
#include "CalibFormats/CaloObjects/interface/CaloTSamplesBase.icc" | ||
#include "CalibFormats/CaloObjects/interface/CaloTSamples.icc" | ||
#include "DataFormats/EcalDigi/interface/EcalConstants.h" | ||
|
||
template class CaloTSamplesBase<float>; | ||
|
||
template class CaloTSamples<float, 10>; | ||
template class CaloTSamples<float, ecalPh2::sampleSize>; | ||
template class CaloTSamples<float, 3>; | ||
template class CaloTSamples<float, 10>; |
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,6 @@ | ||
#ifndef CondFormats_DataRecord_EcalCATIAGainRatiosRcd_H | ||
#define CondFormats_DataRecord_EcalCATIAGainRatiosRcd_H | ||
|
||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
class EcalCATIAGainRatiosRcd : public edm::eventsetup::EventSetupRecordImplementation<EcalCATIAGainRatiosRcd> {}; | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef CondFormats_DataRecord_EcalLiteDTUPedestalsRcd_h | ||
#define CondFormats_DataRecord_EcalLiteDTUPedestalsRcd_h | ||
|
||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
class EcalLiteDTUPedestalsRcd : public edm::eventsetup::EventSetupRecordImplementation<EcalLiteDTUPedestalsRcd> {}; | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "CondFormats/DataRecord/interface/EcalCATIAGainRatiosRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
||
EVENTSETUP_RECORD_REG(EcalCATIAGainRatiosRcd); |
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,4 @@ | ||
#include "CondFormats/DataRecord/interface/EcalLiteDTUPedestalsRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
||
EVENTSETUP_RECORD_REG(EcalLiteDTUPedestalsRcd); |
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,10 @@ | ||
#ifndef CondFormats_EcalObjects_EcalCATIAGainRatios_h | ||
#define CondFormats_EcalObjects_EcalCATIAGainRatios_h | ||
|
||
#include "CondFormats/EcalObjects/interface/EcalCondObjectContainer.h" | ||
|
||
typedef float EcalCATIAGainRatio; | ||
typedef EcalFloatCondObjectContainer EcalCATIAGainRatioMap; | ||
typedef EcalCATIAGainRatioMap EcalCATIAGainRatios; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifndef CondFormats_EcalObject_EcalLiteDTUPedestals_h | ||
#define CondFormats_EcalObject_EcalLiteDTUPedestals_h | ||
|
||
#include "CondFormats/Serialization/interface/Serializable.h" | ||
#include "CondFormats/EcalObjects/interface/EcalCondObjectContainer.h" | ||
#include "DataFormats/EcalDigi/interface/EcalConstants.h" | ||
|
||
class EcalLiteDTUPedestals { | ||
public: | ||
int setMean(unsigned int i, float value) { | ||
if (i >= ecalPh2::NGAINS) | ||
return -1; | ||
else | ||
meanarray[i] = value; | ||
return 1; | ||
} | ||
|
||
int setRMS(unsigned int i, float value) { | ||
if (i >= ecalPh2::NGAINS) | ||
return -1; | ||
else | ||
rmsarray[i] = value; | ||
return 1; | ||
} | ||
|
||
float mean(unsigned int i) const { return meanarray[i]; } | ||
|
||
float rms(unsigned int i) const { return rmsarray[i]; } | ||
|
||
private: | ||
float meanarray[ecalPh2::NGAINS] = {13., 8.}; | ||
float rmsarray[ecalPh2::NGAINS] = {2.8, 1.2}; | ||
COND_SERIALIZABLE; | ||
}; | ||
|
||
typedef EcalCondObjectContainer<EcalLiteDTUPedestals> EcalLiteDTUPedestalsMap; | ||
typedef EcalLiteDTUPedestalsMap::const_iterator EcalLiteDTUPedestalsMapIterator; | ||
|
||
#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
4 changes: 4 additions & 0 deletions
4
CondFormats/EcalObjects/src/T_EventSetup_EcalLiteDTUPedestals.cc
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,4 @@ | ||
#include "CondFormats/EcalObjects/interface/EcalLiteDTUPedestals.h" | ||
#include "FWCore/Utilities/interface/typelookup.h" | ||
|
||
TYPELOOKUP_DATA_REG(EcalLiteDTUPedestalsMap); |
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,4 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
phase2_ecal_devel = cms.Modifier() | ||
|
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,31 @@ | ||
//Namespaces for Phase1 and Phase2 | ||
#ifndef CondFormats_EcalObject_EcalConstants_h | ||
#define CondFormats_EcalObject_EcalConstants_h | ||
|
||
class ecalPh2 { | ||
public: | ||
static constexpr double Samp_Period = 6.25; | ||
static constexpr unsigned int NGAINS = 2; | ||
static constexpr float gains[NGAINS] = {10., 1.}; | ||
static constexpr unsigned int gainId1 = 1; | ||
static constexpr unsigned int gainId10 = 0; | ||
static constexpr unsigned int sampleSize = 16; | ||
static constexpr unsigned int NBITS = 12; // number of available bits | ||
static constexpr unsigned int MAXADC = (1 << NBITS) - 1; // 2^12 -1, adc max range | ||
static constexpr unsigned int kEBChannels = 61200; | ||
static constexpr double maxEneEB = 2000.; | ||
static constexpr unsigned int kNOffsets = 2000; | ||
static constexpr unsigned int kAdcMask = 0xFFF; | ||
static constexpr unsigned int kGainIdMask = 0x3; | ||
|
||
}; // namespace ecalPh2 | ||
|
||
class ecalPh1 { | ||
public: | ||
static constexpr double Samp_Period = 25.; | ||
static constexpr unsigned int NGAINS = 4; | ||
static constexpr float gains[NGAINS] = {0., 12., 6., 1.}; | ||
static constexpr unsigned int sampleSize = 10; | ||
static constexpr unsigned int kNOffsets = 2000; | ||
}; // namespace ecalPh1 | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef DataFormats_EcalDigi_EcalDataFrame_Ph2_h | ||
#define DataFormats_EcalDigi_EcalDataFrame_Ph2_h | ||
#include "DataFormats/EcalDigi/interface/EcalLiteDTUSample.h" | ||
#include "DataFormats/DetId/interface/DetId.h" | ||
#include "DataFormats/Common/interface/DataFrame.h" | ||
#include "DataFormats/EcalDigi/interface/EcalConstants.h" | ||
#include "DataFormats/EcalDetId/interface/EBDetId.h" | ||
|
||
/** \class EcalDataFrame_Ph2 | ||
|
||
*/ | ||
class EcalDataFrame_Ph2 { | ||
public: | ||
EcalDataFrame_Ph2() {} | ||
EcalDataFrame_Ph2(edm::DataFrame const& iframe) : m_data(iframe) {} | ||
|
||
virtual ~EcalDataFrame_Ph2() {} | ||
DetId id() const { return m_data.id(); } | ||
|
||
int size() const { return m_data.size(); } | ||
|
||
EcalLiteDTUSample operator[](int i) const { return m_data[i]; } | ||
EcalLiteDTUSample sample(int i) const { return m_data[i]; } | ||
|
||
typedef EBDetId key_type; /// For the sorted collection | ||
typedef EcalDataFrame_Ph2 Base; | ||
|
||
void setSize(int) {} | ||
void setSample(int i, EcalLiteDTUSample sam) { m_data[i] = sam; } | ||
|
||
static constexpr int MAXSAMPLES = ecalPh2::sampleSize; | ||
|
||
edm::DataFrame const& frame() const { return m_data; } | ||
edm::DataFrame& frame() { return m_data; } | ||
|
||
private: | ||
edm::DataFrame m_data; | ||
}; | ||
|
||
#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,47 @@ | ||
#ifndef DataFormats_EcalDigi_EcalLiteDTUSample_h | ||
#define DataFormats_EcalDigi_EcalLiteDTUSample_h | ||
|
||
#include <iosfwd> | ||
#include <cstdint> | ||
#include "DataFormats/EcalDigi/interface/EcalConstants.h" | ||
|
||
namespace ecalLiteDTU { | ||
typedef uint16_t sample_type; | ||
|
||
/// get the ADC sample (12 bits) | ||
constexpr int adc(sample_type sample) { return sample & ecalPh2::kAdcMask; } | ||
/// get the gainId (2 bits) | ||
constexpr int gainId(sample_type sample) { return (sample >> ecalPh2::NBITS) & ecalPh2::kGainIdMask; } | ||
constexpr sample_type pack(int adc, int gainId) { | ||
return (adc & ecalPh2::kAdcMask) | ((gainId & ecalPh2::kGainIdMask) << ecalPh2::NBITS); | ||
} | ||
} // namespace ecalLiteDTU | ||
|
||
/** \class EcalLiteDTUSample | ||
* Simple container packer/unpacker for a single sample from the Lite_CATIA electronics | ||
* | ||
* | ||
*/ | ||
class EcalLiteDTUSample { | ||
public: | ||
EcalLiteDTUSample() { theSample = 0; } | ||
EcalLiteDTUSample(uint16_t data) { theSample = data; } | ||
EcalLiteDTUSample(int adc, int gainId); | ||
|
||
/// get the raw word | ||
uint16_t raw() const { return theSample; } | ||
/// get the ADC sample (12 bits) | ||
int adc() const { return theSample & ecalPh2::kAdcMask; } | ||
/// get the gainId (2 bits) | ||
int gainId() const { return (theSample >> ecalPh2::NBITS) & ecalPh2::kGainIdMask; } | ||
/// for streaming | ||
uint16_t operator()() const { return theSample; } | ||
operator uint16_t() const { return theSample; } | ||
|
||
private: | ||
uint16_t theSample; | ||
}; | ||
|
||
std::ostream& operator<<(std::ostream&, const EcalLiteDTUSample&); | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "DataFormats/EcalDigi/interface/EcalLiteDTUSample.h" | ||
#include <iostream> | ||
|
||
EcalLiteDTUSample::EcalLiteDTUSample(int adc, int gainId) { | ||
theSample = (adc & ecalPh2::kAdcMask) | ((gainId & ecalPh2::kGainIdMask) << ecalPh2::NBITS); | ||
} | ||
|
||
std::ostream& operator<<(std::ostream& s, const EcalLiteDTUSample& samp) { | ||
s << "ADC=" << samp.adc() << ", gainId=" << samp.gainId(); | ||
return s; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like the opinion of @ggovi prior to signing off for alca: should these be converted to
std::vector
to avoid changing the definitions of the member data ifecalPh2::NGAINS
is modified at some point in the future?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle the number of gains is fixed by the HW (The CATIA ASIC) so unless we change the design of the chips this should never change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think it's fine then.