Skip to content

Commit

Permalink
Synchronise with CMSSW_11_0_0_pre7
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Nov 12, 2020
1 parent 25d6f7f commit 9695d9b
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 46 deletions.
74 changes: 40 additions & 34 deletions EventFilter/EcalRawToDigi/interface/EcalRegionCabling.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,66 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"

class EcalRegionCabling {
public:
EcalRegionCabling(edm::ParameterSet & conf, const EcalElectronicsMapping * m)
: mapping_(m)
{
public:
EcalRegionCabling(edm::ParameterSet& conf, const EcalElectronicsMapping* m) : mapping_(m) {
const edm::ParameterSet esMap = conf.getParameter<edm::ParameterSet>("esMapping");
es_mapping_ = new ESElectronicsMapper(esMap);
}
~EcalRegionCabling(){

~EcalRegionCabling() {
// this pointer is own by this object.
delete es_mapping_;
}
const EcalElectronicsMapping * mapping() const { return mapping_;}
const ESElectronicsMapper * es_mapping() const { return es_mapping_;}
const EcalElectronicsMapping* mapping() const { return mapping_; }
const ESElectronicsMapper* es_mapping() const { return es_mapping_; }

static uint32_t maxElementIndex() {return (FEDNumbering::MAXECALFEDID - FEDNumbering::MINECALFEDID +1);}
static uint32_t maxESElementIndex() { return (FEDNumbering::MAXPreShowerFEDID - FEDNumbering::MINPreShowerFEDID +1);}
static uint32_t maxElementIndex() { return (FEDNumbering::MAXECALFEDID - FEDNumbering::MINECALFEDID + 1); }
static uint32_t maxESElementIndex() {
return (FEDNumbering::MAXPreShowerFEDID - FEDNumbering::MINPreShowerFEDID + 1);
}

static uint32_t elementIndex(const int FEDindex) {
//do a test for the time being
if (FEDindex > FEDNumbering::MAXECALFEDID || FEDindex < FEDNumbering::MINECALFEDID) {
edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
<<" is not between: "<<(int) FEDNumbering::MINECALFEDID
<<" and "<<(int)FEDNumbering::MAXECALFEDID;
return 0;}
edm::LogError("IncorrectMapping") << "FEDindex: " << FEDindex
<< " is not between: " << (int)FEDNumbering::MINECALFEDID << " and "
<< (int)FEDNumbering::MAXECALFEDID;
return 0;
}
uint32_t eI = FEDindex - FEDNumbering::MINECALFEDID;
return eI; }
return eI;
}

static uint32_t esElementIndex(const int FEDindex) {
//do a test for the time being
if (FEDindex > FEDNumbering::MAXPreShowerFEDID || FEDindex < FEDNumbering::MINPreShowerFEDID) {
edm::LogError("IncorrectMapping")<<"FEDindex: "<< FEDindex
<<" is not between: "<<(int) FEDNumbering::MINPreShowerFEDID
<<" and "<<(int)FEDNumbering::MAXPreShowerFEDID;
return 0;}
edm::LogError("IncorrectMapping") << "FEDindex: " << FEDindex
<< " is not between: " << (int)FEDNumbering::MINPreShowerFEDID << " and "
<< (int)FEDNumbering::MAXPreShowerFEDID;
return 0;
}
uint32_t eI = FEDindex - FEDNumbering::MINPreShowerFEDID;
return eI; }
return eI;
}

static int fedIndex(const uint32_t index){
int fI = index+FEDNumbering::MINECALFEDID;
return fI;}

static int esFedIndex(const uint32_t index){
int fI = index+FEDNumbering::MINPreShowerFEDID;
return fI;}
static int fedIndex(const uint32_t index) {
int fI = index + FEDNumbering::MINECALFEDID;
return fI;
}

static int esFedIndex(const uint32_t index) {
int fI = index + FEDNumbering::MINPreShowerFEDID;
return fI;
}

uint32_t elementIndex(const double eta, const double phi) const{
int FEDindex = mapping()->GetFED(eta,phi);
return elementIndex(FEDindex); }
uint32_t elementIndex(const double eta, const double phi) const {
int FEDindex = mapping()->GetFED(eta, phi);
return elementIndex(FEDindex);
}

private:
const EcalElectronicsMapping * mapping_;
const ESElectronicsMapper * es_mapping_;
private:
const EcalElectronicsMapping* mapping_;
const ESElectronicsMapper* es_mapping_;
};

#endif
1 change: 1 addition & 0 deletions EventFilter/EcalRawToDigi/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<use name="CondFormats/DataRecord"/>
<use name="FWCore/Utilities"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/Scalers"/>
<use name="FWCore/Framework"/>
<use name="RecoEcal/EgammaCoreTools"/>
<use name="TrackingTools/Records"/>
Expand Down
29 changes: 17 additions & 12 deletions RecoLocalCalo/Configuration/python/ecalLocalRecoSequence_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,29 @@
#ecalUncalibRecHitSequence = cms.Sequence(ecalGlobalUncalibRecHit*
# ecalDetIdToBeRecovered)

ecalUncalibRecHitSequence = cms.Sequence(ecalMultiFitUncalibRecHit*
ecalUncalibRecHitTask = cms.Task(ecalMultiFitUncalibRecHit,
ecalDetIdToBeRecovered)

ecalRecHitSequence = cms.Sequence(ecalRecHit*
ecalCompactTrigPrim*
ecalTPSkim+
ecalRecHitTask = cms.Task(ecalRecHit,
ecalCompactTrigPrim,
ecalTPSkim,
ecalPreshowerRecHit)

ecalLocalRecoSequence = cms.Sequence(ecalUncalibRecHitSequence*
ecalRecHitSequence)
ecalLocalRecoTask = cms.Task(ecalUncalibRecHitTask,
ecalRecHitTask)

ecalUncalibRecHitSequence = cms.Sequence(ecalUncalibRecHitTask)
ecalRecHitSequence = cms.Sequence(ecalRecHitTask)
ecalLocalRecoSequence = cms.Sequence(ecalLocalRecoTask)


from RecoLocalCalo.EcalRecProducers.ecalDetailedTimeRecHit_cfi import *
_phase2_timing_ecalRecHitSequence = cms.Sequence( ecalRecHitSequence.copy() + ecalDetailedTimeRecHit )
_phase2_timing_ecalRecHitTask = cms.Task( ecalRecHitTask.copy() , ecalDetailedTimeRecHit )
from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
phase2_timing.toReplaceWith( ecalRecHitSequence, _phase2_timing_ecalRecHitSequence )
phase2_timing.toReplaceWith( ecalRecHitTask, _phase2_timing_ecalRecHitTask )

_fastSim_ecalRecHitSequence = ecalRecHitSequence.copyAndExclude([ecalCompactTrigPrim,ecalTPSkim])
_fastSim_ecalUncalibRecHitSequence = ecalUncalibRecHitSequence.copyAndExclude([ecalDetIdToBeRecovered])
_fastSim_ecalRecHitTask = ecalRecHitTask.copyAndExclude([ecalCompactTrigPrim,ecalTPSkim])
_fastSim_ecalUncalibRecHitTask = ecalUncalibRecHitTask.copyAndExclude([ecalDetIdToBeRecovered])
from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toReplaceWith(ecalRecHitSequence, _fastSim_ecalRecHitSequence)
fastSim.toReplaceWith(ecalUncalibRecHitSequence, _fastSim_ecalUncalibRecHitSequence)
fastSim.toReplaceWith(ecalRecHitTask, _fastSim_ecalRecHitTask)
fastSim.toReplaceWith(ecalUncalibRecHitTask, _fastSim_ecalUncalibRecHitTask)

0 comments on commit 9695d9b

Please sign in to comment.