Skip to content

Commit

Permalink
Merge remote-tracking branch 'official-cmssw/CMSSW_8_1_X' into from-C…
Browse files Browse the repository at this point in the history
…MSSW_8_0_0_patch1_relval_81x_rebase
  • Loading branch information
hengne committed Mar 3, 2016
2 parents a3869f8 + fab75b7 commit 94f93db
Show file tree
Hide file tree
Showing 121 changed files with 5,268 additions and 13,999 deletions.
1 change: 1 addition & 0 deletions CalibCalorimetry/CaloTPG/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<use name="CalibFormats/HcalObjects"/>
<use name="Geometry/CaloTopology"/>
<use name="Geometry/HcalTowerAlgo"/>
<use name="CalibCalorimetry/HcalTPGAlgos"/>
<export>
<lib name="1"/>
</export>
7 changes: 6 additions & 1 deletion CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class CaloTPGTranscoderULUTs : public edm::ESProducer {
std::vector<int> LUTfactor;
double nominal_gain;
double RCTLSB;
int NCTScaleShift;
int RCTScaleShift;
};

//
Expand Down Expand Up @@ -96,6 +98,9 @@ CaloTPGTranscoderULUTs::CaloTPGTranscoderULUTs(const edm::ParameterSet& iConfig)
nominal_gain = iConfig.getParameter<double>("nominal_gain");
RCTLSB = iConfig.getParameter<double>("RCTLSB");

edm::ParameterSet hfSS=iConfig.getParameter<edm::ParameterSet>("HFTPScaleShift");
NCTScaleShift = hfSS.getParameter<int>("NCT");
RCTScaleShift = hfSS.getParameter<int>("RCT");
}


Expand Down Expand Up @@ -157,7 +162,7 @@ CaloTPGTranscoderULUTs::produce(const CaloTPGRecord& iRecord)
fullLut.setTopo(htopo.product());

std::auto_ptr<CaloTPGTranscoderULUT> pTCoder(new CaloTPGTranscoderULUT(file1, file2));
pTCoder->setup(fullLut, *theTrigTowerGeometry);
pTCoder->setup(fullLut, *theTrigTowerGeometry, NCTScaleShift, RCTScaleShift);
return std::auto_ptr<CaloTPGTranscoder>( pTCoder );
}

Expand Down
8 changes: 7 additions & 1 deletion CalibCalorimetry/CaloTPG/python/CaloTPGTranscoder_cfi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import FWCore.ParameterSet.Config as cms

hfTPScaleShift =cms.PSet(
NCT= cms.int32(1),
RCT= cms.int32(3)
)

CaloTPGTranscoder = cms.ESProducer("CaloTPGTranscoderULUTs",
hcalLUT1 = cms.FileInPath('CalibCalorimetry/CaloTPG/data/outputLUTtranscoder_physics.dat'),
hcalLUT2 = cms.FileInPath('CalibCalorimetry/CaloTPG/data/TPGcalcDecompress2.txt'),
Expand All @@ -10,5 +15,6 @@
ZS = cms.vint32(4,2,1,0),
LUTfactor = cms.vint32(1,2,5,0),
nominal_gain = cms.double(0.177),
RCTLSB = cms.double(0.25)
RCTLSB = cms.double(0.25),
HFTPScaleShift = hfTPScaleShift,
)
25 changes: 11 additions & 14 deletions CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
//#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "CondFormats/DataRecord/interface/HcalLutMetadataRcd.h"
#include "CalibCalorimetry/HcalTPGAlgos/interface/HcaluLUTTPGCoder.h"

using namespace std;

constexpr float CaloTPGTranscoderULUT::LSB_HF;
constexpr float CaloTPGTranscoderULUT::LSB_HBHE;

CaloTPGTranscoderULUT::CaloTPGTranscoderULUT(const std::string& compressionFile,
const std::string& decompressionFile)
: theTopology(0),
nominal_gain_(0.), rctlsb_factor_(0.),
nominal_gain_(0.), rctlsb_factor_(0.), nctlsb_factor_(0),
compressionFile_(compressionFile),
decompressionFile_(decompressionFile)
{
Expand Down Expand Up @@ -92,7 +90,9 @@ void CaloTPGTranscoderULUT::loadHCALCompress(HcalLutMetadata const& lutMetadata,
double cosh_ieta = fabs(cosh((eta_low + eta_high)/2.));
double granularity = meta->getLutGranularity();

double factor = isHBHE ? (nominal_gain_ / cosh_ieta * granularity) : rctlsb_factor_;
double factor = isHBHE ?
(nominal_gain_ / cosh_ieta * granularity) :
(version==0 ? rctlsb_factor_ : nctlsb_factor_);

LUT tpg = outputLUT_[index][0];
int low = 0;
Expand Down Expand Up @@ -207,15 +207,13 @@ const std::vector<unsigned int>& CaloTPGTranscoderULUT::getCompressionLUT(const
return outputLUT_[itower];
}

void CaloTPGTranscoderULUT::setup(HcalLutMetadata const& lutMetadata, HcalTrigTowerGeometry const& theTrigTowerGeometry)
void CaloTPGTranscoderULUT::setup(HcalLutMetadata const& lutMetadata, HcalTrigTowerGeometry const& theTrigTowerGeometry, int nctScaleShift, int rctScaleShift)
{
theTopology = lutMetadata.topo();
nominal_gain_ = lutMetadata.getNominalGain();
float rctlsb =lutMetadata.getRctLsb();
if (rctlsb != LSB_HBHE && rctlsb != LSB_HF)
throw cms::Exception("RCTLSB") << " value=" << rctlsb << " (should be " << LSB_HBHE
<< " or " << LSB_HF << ")" << std::endl;
rctlsb_factor_ = rctlsb;
theTopology = lutMetadata.topo();
nominal_gain_ = lutMetadata.getNominalGain();

rctlsb_factor_ = HcaluLUTTPGCoder::lsb_*(1<<rctScaleShift);
nctlsb_factor_ = HcaluLUTTPGCoder::lsb_*(1<<nctScaleShift);

if (compressionFile_.empty() && decompressionFile_.empty()) {
loadHCALCompress(lutMetadata,theTrigTowerGeometry);
Expand All @@ -224,4 +222,3 @@ void CaloTPGTranscoderULUT::setup(HcalLutMetadata const& lutMetadata, HcalTrigTo
throw cms::Exception("Not Implemented") << "setup of CaloTPGTranscoderULUT from text files";
}
}

6 changes: 2 additions & 4 deletions CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CaloTPGTranscoderULUT : public CaloTPGTranscoder {
virtual double hcaletValue(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc) const;
virtual bool HTvalid(const int ieta, const int iphi) const;
virtual const std::vector<unsigned int>& getCompressionLUT(const HcalTrigTowerDetId& id) const;
virtual void setup(HcalLutMetadata const&, HcalTrigTowerGeometry const&);
virtual void setup(HcalLutMetadata const&, HcalTrigTowerGeometry const&, int, int);
virtual int getOutputLUTId(const HcalTrigTowerDetId& id) const;
virtual int getOutputLUTId(const int ieta, const int iphi) const;

Expand All @@ -50,15 +50,13 @@ class CaloTPGTranscoderULUT : public CaloTPGTranscoder {
static const unsigned int TPGMAX = 256;
static const bool newHFphi = true;

static constexpr float LSB_HBHE = 0.25f;
static constexpr float LSB_HF = 0.5f;

// Member functions
void loadHCALCompress(HcalLutMetadata const&, HcalTrigTowerGeometry const&) ; //Analytical compression tables

// Member Variables
double nominal_gain_;
double rctlsb_factor_;
double nctlsb_factor_;
std::string compressionFile_;
std::string decompressionFile_;
std::vector<int> ietal;
Expand Down
2 changes: 1 addition & 1 deletion CalibCalorimetry/HcalTPGAlgos/interface/HcaluLUTTPGCoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class HcalDbService;
*/
class HcaluLUTTPGCoder : public HcalTPGCoder {
public:
static const float lsb_;

HcaluLUTTPGCoder(const HcalTopology* topo);
virtual ~HcaluLUTTPGCoder();
Expand Down Expand Up @@ -58,7 +59,6 @@ class HcaluLUTTPGCoder : public HcalTPGCoder {
// constants
static const size_t INPUT_LUT_SIZE = 128;
static const int nFi_ = 72;
static const float lsb_;

// member variables
const HcalTopology* topo_;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand All @@ -9,37 +9,36 @@
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"

class TrackingParticleConversionSelector: public edm::stream::EDProducer<> {
class TrackingParticleConversionRefSelector: public edm::global::EDProducer<> {
public:
TrackingParticleConversionSelector(const edm::ParameterSet& iConfig);
TrackingParticleConversionRefSelector(const edm::ParameterSet& iConfig);

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

virtual void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
virtual void produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override;

private:
edm::EDGetTokenT<TrackingParticleCollection> tpToken_;
};


TrackingParticleConversionSelector::TrackingParticleConversionSelector(const edm::ParameterSet& iConfig):
TrackingParticleConversionRefSelector::TrackingParticleConversionRefSelector(const edm::ParameterSet& iConfig):
tpToken_(consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("src")))
{
produces<TrackingParticleCollection>();
produces<TrackingParticleRefVector>();
}

void TrackingParticleConversionSelector::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
void TrackingParticleConversionRefSelector::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("src", edm::InputTag("mix", "MergedTrackTruth"));
descriptions.add("trackingParticleConversionSelector", desc);
descriptions.add("trackingParticleConversionRefSelector", desc);
}

void TrackingParticleConversionSelector::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
void TrackingParticleConversionRefSelector::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const {
edm::Handle<TrackingParticleCollection> h_tps;
iEvent.getByToken(tpToken_, h_tps);

// Copy TPs because currently we can't process RefVectors of TPs in downstream
auto ret = std::make_unique<TrackingParticleCollection>();
auto ret = std::make_unique<TrackingParticleRefVector>();

// Logic is similar to Validation/RecoEgamma/plugins/PhotonValidator.cc
// and RecoEgamma/EgammaMCTools/src/PhotonMCTruthFinder.cc,
Expand All @@ -49,7 +48,7 @@ void TrackingParticleConversionSelector::produce(edm::Event& iEvent, const edm::
for(const auto& vertRef: tp.decayVertices()) {
for(const auto& tpRef: vertRef->daughterTracks()) {
if(std::abs(tpRef->pdgId()) == 11) {
ret->push_back(*tpRef);
ret->push_back(tpRef);
}
}
}
Expand All @@ -59,4 +58,4 @@ void TrackingParticleConversionSelector::produce(edm::Event& iEvent, const edm::
iEvent.put(std::move(ret));
}

DEFINE_FWK_MODULE(TrackingParticleConversionSelector);
DEFINE_FWK_MODULE(TrackingParticleConversionRefSelector);
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SiPixelGainCalibrationRejectNoisyAndDead : public edm::EDAnalyzer {


std::string noisypixellist_;
bool insertnoisypixelsindb_;
int insertnoisypixelsindb_;
std::string record_;
bool DEBUG;
float pedlow_;
Expand Down
1 change: 0 additions & 1 deletion Configuration/Applications/python/ConfigBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,6 @@ def inGeometryKeys(opt):
self.RECODefaultCFF= 'FastSimulation.Configuration.Reconstruction_AftMix_cff'
self.RECOBEFMIXDefaultCFF = 'FastSimulation.Configuration.Reconstruction_BefMix_cff'
self.RECOBEFMIXDefaultSeq = 'reconstruction_befmix'
self.L1RecoDefaultCFF='FastSimulation.Configuration.L1Reco_cff'
self.DQMOFFLINEDefaultCFF="FastSimulation.Configuration.DQMOfflineMC_cff"

# Mixing
Expand Down
3 changes: 3 additions & 0 deletions DQM/HcalCommon/interface/Axis.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ namespace hcaldqm
Axis(std::string title,AxisType type, AxisQType qtype,
int n, double min, double max, bool log=false);
virtual ~Axis() {}
virtual Axis* makeCopy()
{return new Axis(_title, _type, _qtype, _nbins,
_min, _max, _log);}

// getters of Value to put
virtual int get(HcalDetId const&) {return 0;}
Expand Down
1 change: 1 addition & 0 deletions DQM/HcalCommon/interface/ContainerSingle1D.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace hcaldqm
std::string const& nametitle,
axis::Axis *xaxis,
axis::Axis *yaxis = new ValueAxis(fYaxis, axis::fEntries));
ContainerSingle1D(ContainerSingle1D const&);
virtual ~ContainerSingle1D();

virtual void initialize(std::string const& folder,
Expand Down
2 changes: 2 additions & 0 deletions DQM/HcalCommon/interface/CoordinateAxis.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ namespace hcaldqm
int n, double min, double max, std::string title,
bool log=false);
virtual ~CoordinateAxis() {}
virtual CoordinateAxis* makeCopy()
{return new CoordinateAxis(_type, _ctype, _log);}

virtual int get(HcalDetId const&);
virtual int get(HcalElectronicsId const&);
Expand Down
2 changes: 2 additions & 0 deletions DQM/HcalCommon/interface/FlagAxis.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace hcaldqm
FlagAxis();
FlagAxis(AxisType, std::string, int);
virtual ~FlagAxis() {}
virtual FlagAxis* makeCopy()
{return new FlagAxis(_type, _title, _nbins);}

virtual inline int getBin(int v) {return v+1;}

Expand Down
2 changes: 2 additions & 0 deletions DQM/HcalCommon/interface/ValueAxis.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ namespace hcaldqm
ValueAxis(AxisType type, ValueType vtype, int n,
double min, double max, std::string title, bool log=false);
virtual ~ValueAxis() {}
virtual ValueAxis* makeCopy()
{return new ValueAxis(_type, _vtype, _log);}

virtual int getBin(int);
virtual int getBin(double);
Expand Down
7 changes: 7 additions & 0 deletions DQM/HcalCommon/src/ContainerSingle1D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ namespace hcaldqm
_xaxis(xaxis), _yaxis(yaxis)
{}

ContainerSingle1D::ContainerSingle1D(ContainerSingle1D const& c):
Container(c._folder, c._name)
{
_xaxis = c._xaxis->makeCopy();
_yaxis = c._yaxis->makeCopy();
}

/* virtual */ void ContainerSingle1D::initialize(std::string const& folder,
std::string const& nametitle,
Axis *xaxis, Axis *yaxis, int debug/*=0*/)
Expand Down
35 changes: 9 additions & 26 deletions DQM/HcalCommon/src/DQTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,15 @@ namespace hcaldqm
/* virtual */ void DQTask::analyze(edm::Event const& e,
edm::EventSetup const& es)
{
try
{
this->_resetMonitors(fEvent);
_logger.debug(_name+" processing");
if (!this->_isApplicable(e))
return;

_evsTotal++; _cEvsTotal.fill(_evsTotal);
_evsPerLS++; _cEvsPerLS.fill(_evsPerLS);
_currentLS = e.luminosityBlock();
this->_process(e, es);
}
catch (cms::Exception &exc)
{
_logger.warn("We have cms::Exception Triggered. " +
std::string(exc.what()));
}
catch (std::exception &exc)
{
_logger.warn("we have STD Exception Triggered. " +
std::string(exc.what()));
}
catch (...)
{
_logger.warn("Unknown Exception Triggered");
}
this->_resetMonitors(fEvent);
_logger.debug(_name+" processing");
if (!this->_isApplicable(e))
return;

_evsTotal++; _cEvsTotal.fill(_evsTotal);
_evsPerLS++; _cEvsPerLS.fill(_evsPerLS);
_currentLS = e.luminosityBlock();
this->_process(e, es);
}

/* virtual */ void DQTask::bookHistograms(DQMStore::IBooker &ib,
Expand Down
5 changes: 5 additions & 0 deletions DQM/HcalTasks/plugins/TPTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ TPTask::TPTask(edm::ParameterSet const& ps):
int soiEt_d = hddigi->SOI_compressedEt();
int soiFG_d = hddigi->SOI_fineGrain() ? 1 : 0;
HcalTrigTowerDetId tid = hddigi->id();
// NOTE: skip1x1 should've done that - in the emap it's depth10
// in data in 80X it's 0 for some reason!!!
// skip using version number
if (tid.version()>0)
continue;

// tmp
if (hddigi->id().depth()==1)
Expand Down
2 changes: 1 addition & 1 deletion DQM/HcalTasks/python/OfflineSourceSequence_cosmic.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
# set the Emulator label for TP Task
tpTask.tagEmul = cms.untracked.InputTag("valHcalTriggerPrimitiveDigis")

# no TP Task for Cosmics
hcalOfflineSourceSequence = cms.Sequence(
digiTask
+tpTask
+recHitTask
+rawTask)

10 changes: 6 additions & 4 deletions DQM/SiStripMonitorTrack/interface/SiStripMonitorTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,19 @@ class SiStripMonitorTrack : public DQMEDAnalyzer {
void AllClusters(const edm::Event& ev, const edm::EventSetup& es);
void trackStudyFromTrack(edm::Handle<reco::TrackCollection > trackCollectionHandle, const edm::EventSetup& es);
void trackStudyFromTrajectory(edm::Handle<TrajTrackAssociationCollection> TItkAssociatorCollection, const edm::EventSetup& es);
void trajectoryStudy(const edm::Ref<std::vector<Trajectory> > traj, const edm::EventSetup& es);
void trajectoryStudy(const edm::Ref<std::vector<Trajectory> > traj, const edm::EventSetup& es, bool track_ok);
void trackStudy(const edm::Event& ev, const edm::EventSetup& es);
bool trackFilter(const reco::Track& track);
// LocalPoint project(const GeomDet *det,const GeomDet* projdet,LocalPoint position,LocalVector trackdirection)const;
void hitStudy(const edm::EventSetup& es,
const ProjectedSiStripRecHit2D* projhit,
const SiStripMatchedRecHit2D* matchedhit,
const SiStripRecHit2D* hit2D,
const SiStripRecHit1D* hit1D,
LocalVector localMomentum);
bool clusterInfos(SiStripClusterInfo* cluster, const uint32_t detid, enum ClusterFlags flags, LocalVector LV, const Det2MEs& MEs);
template <class T> void RecHitInfo(const T* tkrecHit, LocalVector LV, const edm::EventSetup&);
LocalVector localMomentum,
const bool track_ok);
bool clusterInfos(SiStripClusterInfo* cluster, const uint32_t detid, enum ClusterFlags flags, bool track_ok, LocalVector LV, const Det2MEs& MEs);
template <class T> void RecHitInfo(const T* tkrecHit, LocalVector LV, const edm::EventSetup&, bool ok);

// fill monitorables
// void fillModMEs(SiStripClusterInfo* cluster,std::string name, float cos, const uint32_t detid, const LocalVector LV);
Expand Down
Loading

0 comments on commit 94f93db

Please sign in to comment.