Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
3,360 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "CalibFormats/CaloObjects/interface/CaloTSamplesBase.icc" | ||
#include "CalibFormats/CaloObjects/interface/CaloTSamples.icc" | ||
#include "CondFormats/EcalObjects/interface/EcalConstants.h" | ||
|
||
template class CaloTSamplesBase<float>; | ||
|
||
template class CaloTSamples<float, ecalPh2::sampleSize>; | ||
template class CaloTSamples<float, 3>; |
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,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[2] = {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[4] = {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,39 @@ | ||
#ifndef CondFormats_EcalObject_EcalLiteDTUPedestals_h | ||
#define CondFormats_EcalObject_EcalLiteDTUPedestals_h | ||
|
||
#include "CondFormats/Serialization/interface/Serializable.h" | ||
#include "CondFormats/EcalObjects/interface/EcalCondObjectContainer.h" | ||
#include "CondFormats/EcalObjects/interface/EcalConstants.h" | ||
|
||
class EcalLiteDTUPedestals { | ||
public: | ||
float meanarray[2] = {13., 8.}; | ||
float rmsarray[2] = {2.8, 1.2}; | ||
|
||
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]; } | ||
|
||
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,8 @@ | ||
<?xml version='1.0' encoding="UTF-8"?> | ||
<!DOCTYPE PoolDatabase SYSTEM "InMemory"> | ||
<PoolDatabase > | ||
<PoolContainer name="EcalLiteDTUPedestals" > | ||
<Class name="EcalLiteDTUPedestals" mapping_version="EcalLiteDTUPedestals_automatic_default" > | ||
</Class > | ||
</PoolContainer > | ||
</PoolDatabase > |
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,71 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
# | ||
# Full-scale Digitization of the simulated hits | ||
# in all CMS subdets : Tracker, ECAL, HCAl, Muon's; | ||
# MixingModule (at least in zero-pileup mode) needs | ||
# to be included to make Digi's operational, since | ||
# it's required for ECAL/HCAL & Muon's | ||
# Defined in a separate fragment | ||
# | ||
# Tracker Digis (Pixel + SiStrips) are now made in the mixing | ||
# module, so the old "trDigi" sequence has been taken out. | ||
# | ||
|
||
# Calorimetry Digis (Ecal + Hcal) - * unsuppressed * | ||
# returns sequence "calDigi" | ||
|
||
from SimCalorimetry.Configuration.SimCalorimetry_Ph2_cff import * | ||
# Muon Digis (CSC + DT + RPC) | ||
# returns sequence "muonDigi" | ||
# | ||
from SimMuon.Configuration.SimMuon_cff import * | ||
# | ||
# TrackingParticle Producer is now part of the mixing module, so | ||
# it is no longer run here. | ||
# | ||
from SimGeneral.Configuration.SimGeneral_cff import * | ||
|
||
# add updating the GEN information by default | ||
from Configuration.StandardSequences.Generator_cff import * | ||
from GeneratorInterface.Core.generatorSmeared_cfi import * | ||
from SimGeneral.PileupInformation.genPUProtons_cfi import * | ||
|
||
doAllDigiTask = cms.Task(generatorSmeared, calDigiTask, muonDigiTask) | ||
pdigiTask_nogen = cms.Task(generatorSmeared, cms.TaskPlaceholder("randomEngineStateProducer"), cms.TaskPlaceholder("mix"), doAllDigiTask, addPileupInfo, genPUProtons) | ||
pdigiTask = cms.Task(pdigiTask_nogen, fixGenInfoTask) | ||
|
||
doAllDigi = cms.Sequence(doAllDigiTask) | ||
pdigi = cms.Sequence(pdigiTask) | ||
pdigi_valid = cms.Sequence(pdigiTask) | ||
pdigi_nogen=cms.Sequence(pdigiTask_nogen) | ||
pdigi_valid_nogen=cms.Sequence(pdigiTask_nogen) | ||
|
||
from GeneratorInterface.HiGenCommon.HeavyIon_cff import * | ||
pdigiTask_hi = cms.Task(pdigiTask, heavyIon) | ||
pdigiTask_hi_nogen = cms.Task(pdigiTask_nogen, genJetMETTask, heavyIon) | ||
pdigi_hi=cms.Sequence(pdigiTask_hi) | ||
pdigi_hi_nogen=cms.Sequence(pdigiTask_hi_nogen) | ||
|
||
from Configuration.Eras.Modifier_fastSim_cff import fastSim | ||
def _fastSimDigis(process): | ||
import FastSimulation.Configuration.DigiAliases_cff as DigiAliases | ||
|
||
# pretend these digis have been through digi2raw and raw2digi, by using the approprate aliases | ||
# use an alias to make the mixed track collection available under the usual label | ||
from FastSimulation.Configuration.DigiAliases_cff import loadDigiAliases | ||
loadDigiAliases(process) | ||
# no need for the aliases for premixing stage1 | ||
modifyDigi_fastSimDigis = (fastSim & ~premix_stage1).makeProcessModifier(_fastSimDigis) | ||
|
||
#phase 2 common mods | ||
def _modifyEnableHcalHardcode( theProcess ): | ||
from CalibCalorimetry.HcalPlugins.Hcal_Conditions_forGlobalTag_cff import hcal_db_producer as _hcal_db_producer, es_hardcode as _es_hardcode, es_prefer_hcalHardcode as _es_prefer_hcalHardcode | ||
theProcess.hcal_db_producer = _hcal_db_producer | ||
theProcess.es_hardcode = _es_hardcode | ||
theProcess.es_prefer_hcalHardcode = _es_prefer_hcalHardcode | ||
|
||
from Configuration.Eras.Modifier_hcalHardcodeConditions_cff import hcalHardcodeConditions | ||
modifyEnableHcalHardcode_ = hcalHardcodeConditions.makeProcessModifier( _modifyEnableHcalHardcode ) | ||
|
||
|
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,38 @@ | ||
#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 "CondFormats/EcalObjects/interface/EcalConstants.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]; } | ||
|
||
// FIXME (shall we throw??) | ||
void setSize(int) {} | ||
void setSample(int i, EcalLiteDTUSample sam) { m_data[i] = sam; } | ||
|
||
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 "CondFormats/EcalObjects/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
Oops, something went wrong.