Skip to content

Commit

Permalink
Merge CMSSW_10_5_X into CMSSW_10_5_DEVEL_X.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed Feb 5, 2019
2 parents f1f6c35 + d4a52cb commit e262b75
Show file tree
Hide file tree
Showing 32 changed files with 965 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"

Expand All @@ -33,6 +34,8 @@ class SiPixelGainCalibrationServiceBase {

SiPixelGainCalibrationServiceBase(){};
virtual ~SiPixelGainCalibrationServiceBase(){};

static void fillPSetDescription(edm::ParameterSetDescription& desc) {}

// default inplementation from PixelThresholdClusterizer
virtual void calibrate(uint32_t detID, DigiIterator b, DigiIterator e, float conversionFactor, float offset, int * electron);
Expand Down
3 changes: 3 additions & 0 deletions Configuration/Geometry/python/GeometryExtended2018NoSD_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
#
# Ideal 2018 geometry with no SD declaration
from Geometry.CMSCommonData.cmsExtendedGeometry2018NoSDXML_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import *
from Geometry.HcalCommonData.hcalParameters_cfi import *
from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import *

9 changes: 8 additions & 1 deletion Configuration/StandardSequences/python/Reconstruction_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
# Low pT electrons
from RecoEgamma.EgammaElectronProducers.lowPtGsfElectronSequence_cff import *

# Conversions from lowPtGsfTracks
from RecoEgamma.EgammaPhotonProducers.conversionOpenTrackSequence_cff import *
from RecoEgamma.EgammaPhotonProducers.gsfTracksOpenConversionSequence_cff import *


localreco = cms.Sequence(bunchSpacingProducer+trackerlocalreco+muonlocalreco+calolocalreco+castorreco)
localreco_HcalNZS = cms.Sequence(bunchSpacingProducer+trackerlocalreco+muonlocalreco+calolocalrecoNZS+castorreco)

Expand Down Expand Up @@ -157,7 +162,9 @@
PFTau*
reducedRecHits*
cosmicDCTracksSeq*
lowPtGsfElectronSequence
lowPtGsfElectronSequence*
conversionOpenTrackSequence*
gsfTracksOpenConversionSequence
)

# AA data with pp reco
Expand Down
1 change: 1 addition & 0 deletions DataFormats/EgammaCandidates/interface/Conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace reco {
arbitratedEcalSeeded=1,
arbitratedMerged=2,
arbitratedMergedEcalGeneral=3,
gsfTracksOpenOnly=4,
highPurity=8,
highEfficiency=9,
ecalMatched1Track=10,
Expand Down
8 changes: 5 additions & 3 deletions DataFormats/EgammaTrackReco/interface/ConversionTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ namespace reco
class ConversionTrack
{
public:
ConversionTrack() : isTrackerOnly_(false), isArbitratedEcalSeeded_(false), isArbitratedMerged_(false),
ConversionTrack() : isTrackerOnly_(false), isGsfTrackOpen_(false), isArbitratedEcalSeeded_(false), isArbitratedMerged_(false),
isArbitratedMergedEcalGeneral_(false) {}
ConversionTrack(const TrackBaseRef &trk) :
track_(trk), isTrackerOnly_(false), isArbitratedEcalSeeded_(false), isArbitratedMerged_(false),
track_(trk), isTrackerOnly_(false),isGsfTrackOpen_(false), isArbitratedEcalSeeded_(false), isArbitratedMerged_(false),
isArbitratedMergedEcalGeneral_(false) {}
virtual ~ConversionTrack() {}

Expand All @@ -32,21 +32,23 @@ namespace reco
const edm::Ref<std::vector<Trajectory> > &trajRef() const { return traj_; }
void setTrajRef(edm::Ref<std::vector<Trajectory> > tr) { traj_ = tr; }
void setIsTrackerOnly(bool b) { isTrackerOnly_ = b; }
void setIsGsfTrackOpen(bool b) { isGsfTrackOpen_ = b; }
void setIsArbitratedEcalSeeded(bool b) { isArbitratedEcalSeeded_ = b; }
void setIsArbitratedMerged(bool b) { isArbitratedMerged_ = b; }
void setIsArbitratedMergedEcalGeneral(bool b) { isArbitratedMergedEcalGeneral_ = b; }
bool isTrackerOnly() const { return isTrackerOnly_;}
bool isArbitratedEcalSeeded() const { return isArbitratedEcalSeeded_;}
bool isArbitratedMerged() const { return isArbitratedMerged_;}
bool isArbitratedMergedEcalGeneral() const { return isArbitratedMergedEcalGeneral_;}

bool isGsfTrackOpen() const { return isGsfTrackOpen_;}



private:
TrackBaseRef track_; //ptr to track
edm::Ref<std::vector<Trajectory> > traj_; //reference to a trajectory
bool isTrackerOnly_; //from general tracks collection
bool isGsfTrackOpen_; //from gsf track open sequence for low pt electrons for B
bool isArbitratedEcalSeeded_; //from in out or out-in ecal-seeded collections (arbitrated)
bool isArbitratedMerged_; //is arbitrated among all input collections
bool isArbitratedMergedEcalGeneral_; //is arbitrated among ecal-seeded and generalTracks
Expand Down
3 changes: 2 additions & 1 deletion DataFormats/EgammaTrackReco/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<class name="edm::ValueMap<reco::CaloClusterPtrVector>" />
<class name="edm::Wrapper<edm::ValueMap<reco::CaloClusterPtr> >" />
<class name="edm::Wrapper<edm::ValueMap<reco::CaloClusterPtrVector> >" />
<class name="reco::ConversionTrack" ClassVersion="10">
<class name="reco::ConversionTrack" ClassVersion="11">
<version ClassVersion="11" checksum="1446912891"/>
<version ClassVersion="10" checksum="2951396223"/>
<field name="traj_" transient="true" />
</class>
Expand Down
5 changes: 4 additions & 1 deletion EventFilter/SiPixelRawToDigi/interface/PixelDataFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "DataFormats/Common/interface/DetSetVector.h"
#include "EventFilter/SiPixelRawToDigi/interface/ErrorChecker.h"
#include "FWCore/Utilities/interface/typedefs.h"
#include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h"

#include <vector>
#include <map>
Expand All @@ -64,6 +65,8 @@ class PixelDataFormatter {
typedef std::pair<DetDigis::const_iterator, DetDigis::const_iterator> Range;
typedef std::vector<SiPixelRawDataError> DetErrors;
typedef std::map<cms_uint32_t, DetErrors> Errors;
typedef std::vector<PixelFEDChannel> DetBadChannels;
typedef std::map<cms_uint32_t, DetBadChannels> BadChannels;

typedef cms_uint32_t Word32;
typedef cms_uint64_t Word64;
Expand All @@ -80,7 +83,7 @@ class PixelDataFormatter {

void interpretRawData(bool& errorsInEvent, int fedId, const FEDRawData & data, Collection & digis, Errors & errors);

void formatRawData( unsigned int lvl1_ID, RawData & fedRawData, const Digis & digis);
void formatRawData( unsigned int lvl1_ID, RawData & fedRawData, const Digis & digis, const BadChannels & badChannels);

cms_uint32_t linkId(cms_uint32_t word32) { return (word32 >> LINK_shift) & LINK_mask; }

Expand Down
27 changes: 25 additions & 2 deletions EventFilter/SiPixelRawToDigi/plugins/SiPixelDigiToRaw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "EventFilter/SiPixelRawToDigi/interface/PixelDataFormatter.h"
#include "CondFormats/SiPixelObjects/interface/PixelFEDCabling.h"

#include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h"

#include <atomic>
#include <memory>

Expand Down Expand Up @@ -63,10 +65,11 @@ class SiPixelDigiToRaw final : public edm::global::EDProducer<edm::LuminosityBlo

private:

mutable std::atomic_flag lock_{ ATOMIC_FLAG_INIT };
mutable std::atomic_flag lock_ = ATOMIC_FLAG_INIT;
CMS_THREAD_GUARD(lock_) mutable edm::ESWatcher<SiPixelFedCablingMapRcd> recordWatcher;
CMS_THREAD_GUARD(lock_) mutable std::shared_ptr<pr::Cache> previousCache_;
const edm::EDGetTokenT<edm::DetSetVector<PixelDigi>> tPixelDigi;
const edm::EDGetTokenT<PixelFEDChannelCollection> theBadPixelFEDChannelsToken;
const edm::EDPutTokenT<FEDRawDataCollection> putToken_;
const bool usePilotBlade = false; // I am not yet sure we need it here?
const bool usePhase1;
Expand All @@ -76,6 +79,7 @@ using namespace std;

SiPixelDigiToRaw::SiPixelDigiToRaw( const edm::ParameterSet& pset ) :
tPixelDigi{ consumes<edm::DetSetVector<PixelDigi> >(pset.getParameter<edm::InputTag>("InputLabel")) },
theBadPixelFEDChannelsToken{ consumes<PixelFEDChannelCollection>(pset.getParameter<edm::InputTag>("InputLabel")) },
putToken_{produces<FEDRawDataCollection>()},
usePhase1{ pset.getParameter<bool> ("UsePhase1") }
{
Expand Down Expand Up @@ -130,6 +134,25 @@ void SiPixelDigiToRaw::produce( edm::StreamID, edm::Event& ev,

LogDebug("SiPixelDigiToRaw") << cache->cablingTree_->version();

PixelDataFormatter::BadChannels badChannels;
edm::Handle<PixelFEDChannelCollection> pixelFEDChannelCollectionHandle;
if (ev.getByToken(theBadPixelFEDChannelsToken, pixelFEDChannelCollectionHandle)){
for (auto const& fedChannels: *pixelFEDChannelCollectionHandle) {
PixelDataFormatter::DetBadChannels detBadChannels;
for(const auto& fedChannel: fedChannels) {
sipixelobjects::CablingPathToDetUnit path={fedChannel.fed, fedChannel.link, 1};
if (cache->cablingTree_->findItem(path)!=nullptr) {
detBadChannels.push_back(fedChannel);
} else {
edm::LogError("SiPixelDigiToRaw")
<<" FED "<<fedChannel.fed<<" Link "<<fedChannel.link<<" for module "<<fedChannels.detId()
<<" marked bad, but this channel does not exist in the cabling map" <<endl;
}
} // channels reading a module
if (!detBadChannels.empty()) badChannels.insert({fedChannels.detId(), std::move(detBadChannels)});
} // loop on detId-s
}

//PixelDataFormatter formatter(cablingTree_.get());
PixelDataFormatter formatter(cache->cablingTree_.get(), usePhase1);

Expand All @@ -139,7 +162,7 @@ void SiPixelDigiToRaw::produce( edm::StreamID, edm::Event& ev,
FEDRawDataCollection buffers;

// convert data to raw
formatter.formatRawData( ev.id().event(), rawdata, digis );
formatter.formatRawData( ev.id().event(), rawdata, digis, badChannels);

// pack raw data into collection
for (auto const* fed: cache->cablingTree_->fedList()) {
Expand Down
21 changes: 1 addition & 20 deletions EventFilter/SiPixelRawToDigi/plugins/SiPixelRawToDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ SiPixelRawToDigi::SiPixelRawToDigi( const edm::ParameterSet& conf )
usererrorlist = config_.getParameter<std::vector<int> > ("UserErrorList");
}
tFEDRawDataCollection = consumes <FEDRawDataCollection> (config_.getParameter<edm::InputTag>("InputLabel"));
theBadPixelFEDChannelsLabel = consumes<PixelFEDChannelCollection>(config_.getParameter<edm::InputTag>("BadPixelFEDChannelsInputLabel"));

//start counters
ndigis = 0;
Expand Down Expand Up @@ -153,7 +152,6 @@ SiPixelRawToDigi::fillDescriptions(edm::ConfigurationDescriptions& descriptions)
desc.add<bool>("UsePhase1",false)->setComment("## Use phase1");
desc.add<std::string>("CablingMapLabel","")->setComment("CablingMap label"); //Tav
desc.addOptional<bool>("CheckPixelOrder"); // never used, kept for back-compatibility
desc.add<edm::InputTag>("BadPixelFEDChannelsInputLabel",edm::InputTag("mix"));
descriptions.add("siPixelRawToDigi",desc);

}
Expand Down Expand Up @@ -317,29 +315,12 @@ void SiPixelRawToDigi::produce( edm::Event& ev,
hDigi->Fill(formatter.nDigis());
}


//------------------------------------
//send digis and errors back to framework

edm::Handle<PixelFEDChannelCollection> pixelFEDChannelCollectionHandle;
std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ = nullptr;
if (ev.getByToken(theBadPixelFEDChannelsLabel, pixelFEDChannelCollectionHandle)){

const PixelFEDChannelCollection * pfcc= pixelFEDChannelCollectionHandle.product();
PixelFEDChannelCollection_ = std::make_unique<PixelFEDChannelCollection>(*pfcc);
}

ev.put(std::move(collection));
if(includeErrors){
ev.put(std::move(errorcollection));
ev.put(std::move(tkerror_detidcollection));
ev.put(std::move(usererror_detidcollection), "UserErrorModules");
if (PixelFEDChannelCollection_ == nullptr){
ev.put(std::move(disabled_channelcollection));
}
else{
ev.put(std::move(PixelFEDChannelCollection_));
}
ev.put(std::move(disabled_channelcollection));
}
}
// declare this as a framework plugin
Expand Down
2 changes: 0 additions & 2 deletions EventFilter/SiPixelRawToDigi/plugins/SiPixelRawToDigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Utilities/interface/CPUTimer.h"
#include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h"

class SiPixelFedCablingTree;
class SiPixelFedCabling;
Expand Down Expand Up @@ -45,7 +44,6 @@ class SiPixelRawToDigi : public edm::stream::EDProducer<> {
const SiPixelQuality* badPixelInfo_;
PixelUnpackingRegions* regions_;
edm::EDGetTokenT<FEDRawDataCollection> tFEDRawDataCollection;
edm::EDGetTokenT<PixelFEDChannelCollection> theBadPixelFEDChannelsLabel;
TH1D *hCPU, *hDigi;
std::unique_ptr<edm::CPUTimer> theTimer;
bool includeErrors;
Expand Down
2 changes: 0 additions & 2 deletions EventFilter/SiPixelRawToDigi/python/SiPixelRawToDigi_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@

from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel
phase1Pixel.toModify(siPixelDigis, UsePhase1=True)
from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
premix_stage2.toModify(siPixelDigis, BadPixelFEDChannelsInputLabel = "mixData")
42 changes: 33 additions & 9 deletions EventFilter/SiPixelRawToDigi/src/PixelDataFormatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void PixelDataFormatter::interpretRawData(bool& errorsInEvent, int fedId, const
// }


void PixelDataFormatter::formatRawData(unsigned int lvl1_ID, RawData & fedRawData, const Digis & digis)
void PixelDataFormatter::formatRawData(unsigned int lvl1_ID, RawData & fedRawData, const Digis & digis, const BadChannels & badChannels)
{
std::map<int, vector<Word32> > words;

Expand All @@ -294,27 +294,51 @@ void PixelDataFormatter::formatRawData(unsigned int lvl1_ID, RawData & fedRawDat
if(barrel) layer = PixelROC::bpixLayerPhase1(rawId);
//if(DANEK) cout<<" layer "<<layer<<" "<<phase1<<endl;

BadChannels::const_iterator detBadChannels=badChannels.find(rawId);

hasDetDigis++;
const DetDigis & detDigis = im->second;
for (DetDigis::const_iterator it = detDigis.begin(); it != detDigis.end(); it++) {
theDigiCounter++;
const PixelDigi & digi = (*it);
int status=0;
int fedId=0;

if(layer==1 && phase1) status = digi2wordPhase1Layer1( rawId, digi, words);
else status = digi2word( rawId, digi, words);
if(layer==1 && phase1) fedId = digi2wordPhase1Layer1( rawId, digi, words);
else fedId = digi2word( rawId, digi, words);

if (status) {
if (fedId<0) {
LogError("FormatDataException")
<<" digi2word returns error #"<<status
<<" digi2word returns error #"<<fedId
<<" Ndigis: "<<theDigiCounter << endl
<<" detector: "<<rawId<< endl
<< print(digi) <<endl;
} // if (status)
} else if (detBadChannels!=badChannels.end()) {
auto badChannel=std::find_if(detBadChannels->second.begin(),
detBadChannels->second.end(),
[&] (const PixelFEDChannel& ch) {
return (int(ch.fed)==fedId && ch.link==linkId(words[fedId].back()));
});
if (badChannel!=detBadChannels->second.end()) {
LogError("FormatDataException")
<<" while marked bad, found digi for FED "<<fedId<<" Link "<<linkId(words[fedId].back())
<<" on module "<<rawId<< endl
<< print(digi) <<endl;
}
} // if (fedId)
} // for (DetDigis
} // for (Digis
LogTrace(" allDetDigis/hasDetDigis : ") << allDetDigis<<"/"<<hasDetDigis;

// fill FED error 25 words
for(const auto& detBadChannels: badChannels) {
for(const auto& badChannel: detBadChannels.second) {
unsigned int FEDError25=25;
Word32 word = (badChannel.link << LINK_shift) | (FEDError25 << ROC_shift);
words[badChannel.fed].push_back(word);
theWordCounter++;
}
}

typedef std::map<int, vector<Word32> >::const_iterator RI;
for (RI feddata = words.begin(); feddata != words.end(); feddata++) {
int fedId = feddata->first;
Expand Down Expand Up @@ -382,7 +406,7 @@ int PixelDataFormatter::digi2word( cms_uint32_t detId, const PixelDigi& digi,
words[fedId].push_back(word);
theWordCounter++;

return 0;
return fedId;
}
int PixelDataFormatter::digi2wordPhase1Layer1( cms_uint32_t detId, const PixelDigi& digi,
std::map<int, vector<Word32> > & words) const
Expand Down Expand Up @@ -412,7 +436,7 @@ int PixelDataFormatter::digi2wordPhase1Layer1( cms_uint32_t detId, const PixelDi
words[fedId].push_back(word);
theWordCounter++;

return 0;
return fedId;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@
'Geometry/HcalCommonData/data/hcalouteralgo.xml',
'Geometry/HcalCommonData/data/hcalforwardalgo.xml',
'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml',
'Geometry/HcalCommonData/data/hcalSimNumbering/2018Plan36/hcalSimNumbering.xml',
'Geometry/HcalCommonData/data/hcalRecNumbering/2018Plan36/hcalRecNumbering.xml',
'Geometry/MuonCommonData/data/mbCommon/2017/v1/mbCommon.xml',
'Geometry/MuonCommonData/data/mb1/2015/v1/mb1.xml',
'Geometry/MuonCommonData/data/mb2/2015/v1/mb2.xml',
Expand All @@ -246,7 +248,20 @@
'Geometry/ForwardCommonData/data/lumirotations.xml',
'Geometry/ForwardCommonData/data/zdc.xml',
'Geometry/ForwardCommonData/data/zdclumi.xml',
'Geometry/ForwardCommonData/data/cmszdc.xml',
'Geometry/ForwardCommonData/data/cmszdc.xml')+cms.vstring(
'Geometry/MuonCommonData/data/muonNumbering/2017/v1/muonNumbering.xml',
'Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml',
'Geometry/TrackerRecoData/data/PhaseI/trackerRecoMaterial.xml',
'Geometry/HcalSimData/data/hf.xml',
'Geometry/HcalSimData/data/hfpmt.xml',
'Geometry/HcalSimData/data/hffibrebundle.xml',
'Geometry/HcalSimData/data/CaloUtil.xml',
'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml',
'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml',
'Geometry/CSCGeometryBuilder/data/cscSpecs.xml',
'Geometry/RPCGeometryBuilder/data/RPCSpecs.xml',
'Geometry/GEMGeometryBuilder/data/GEMSpecsFilter17.xml',
'Geometry/GEMGeometryBuilder/data/v4/GEMSpecs.xml',
'Geometry/CMSCommonData/data/FieldParameters.xml'),
rootNodeName = cms.string('cms:OCMS')
)
Expand Down
7 changes: 7 additions & 0 deletions HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,18 @@ def customiseFor2017DtUnpacking(process):

return process

def customiseFor25811(process):
for prod in producers_by_type(process, "SiPixelClusterProducer"):
if hasattr(prod, "MissCalibrate") and not prod.MissCalibrate.isTracked():
prod.MissCalibrate = cms.bool(prod.MissCalibrate.value())
return process

# CMSSW version specific customizations
def customizeHLTforCMSSW(process, menuType="GRun"):

# add call to action function in proper order: newest last!
# process = customiseFor12718(process)

process = customiseFor25811(process)

return process
Loading

0 comments on commit e262b75

Please sign in to comment.