forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'from-CMSSW_10_2_X_2018-04-17-2300' into CMSSW_10_1_X_ta…
…u-pog_recoOnMiniAOD
- Loading branch information
Showing
832 changed files
with
28,716 additions
and
18,135 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
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
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
33 changes: 33 additions & 0 deletions
33
CalibTracker/SiPixelESProducers/interface/SiPixel2DTemplateDBObjectESProducer.h
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,33 @@ | ||
#ifndef CalibTracker_SiPixelESProducers_SiPixel2DTemplateDBObjectESProducer_h | ||
#define CalibTracker_SiPixelESProducers_SiPixel2DTemplateDBObjectESProducer_h | ||
// -*- C++ -*- | ||
// | ||
// Package: SiPixel2DTemplateDBObjectESProducer | ||
// Class: SiPixel2DTemplateDBObjectESProducer | ||
// | ||
/**\class SiPixel2DTemplateDBObjectESProducer SiPixel2DTemplateDBObjectESProducer.cc CalibTracker/SiPixelESProducers/plugin/SiPixel2DTemplateDBObjectESProducer.cc | ||
Description: ESProducer for magnetic-field-dependent local reco templates | ||
Implementation: Used inside the RecoLocalTracker/Records/TkPixelRecord to select the correct db for given magnetic field | ||
*/ | ||
// | ||
// Original Author: D.Fehling | ||
// Created: Tue Sep 29 14:49:31 CET 2009 | ||
// | ||
// | ||
|
||
#include "FWCore/Framework/interface/ESProducer.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "CondFormats/SiPixelObjects/interface/SiPixel2DTemplateDBObject.h" | ||
#include "CalibTracker/Records/interface/SiPixel2DTemplateDBObjectESProducerRcd.h" | ||
|
||
class SiPixel2DTemplateDBObjectESProducer : public edm::ESProducer { | ||
|
||
public: | ||
|
||
SiPixel2DTemplateDBObjectESProducer(const edm::ParameterSet& iConfig); | ||
~SiPixel2DTemplateDBObjectESProducer() override; | ||
std::shared_ptr<SiPixel2DTemplateDBObject> produce(const SiPixel2DTemplateDBObjectESProducerRcd &); | ||
}; | ||
#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
64 changes: 64 additions & 0 deletions
64
CalibTracker/SiPixelESProducers/plugins/SiPixel2DTemplateDBObjectESProducer.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,64 @@ | ||
// -*- C++ -*- | ||
// Package: SiPixelESProducers | ||
// Class: SiPixel2DTemplateDBObjectESProducer | ||
// Original Author: D.Fehling | ||
// Created: Tue Sep 29 14:49:31 CET 2009 | ||
// | ||
|
||
#include "CalibTracker/SiPixelESProducers/interface/SiPixel2DTemplateDBObjectESProducer.h" | ||
|
||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Utilities/interface/do_nothing_deleter.h" | ||
|
||
#include <memory> | ||
#include "boost/mpl/vector.hpp" | ||
|
||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
#include "MagneticField/Engine/interface/MagneticField.h" | ||
|
||
using namespace edm; | ||
|
||
SiPixel2DTemplateDBObjectESProducer::SiPixel2DTemplateDBObjectESProducer(const edm::ParameterSet& iConfig) { | ||
setWhatProduced(this); | ||
} | ||
|
||
|
||
SiPixel2DTemplateDBObjectESProducer::~SiPixel2DTemplateDBObjectESProducer(){ | ||
} | ||
|
||
|
||
|
||
|
||
std::shared_ptr<SiPixel2DTemplateDBObject> SiPixel2DTemplateDBObjectESProducer::produce(const SiPixel2DTemplateDBObjectESProducerRcd & iRecord) { | ||
|
||
ESHandle<MagneticField> magfield; | ||
iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield); | ||
|
||
GlobalPoint center(0.0, 0.0, 0.0); | ||
float theMagField = magfield.product()->inTesla(center).mag(); | ||
|
||
// std::string label = "numerator"; // &&& Temporary: matches Barrel Layer1 for 2017 data | ||
// std::string label = "denominator"; // &&& Temporary: matches Barrel Layer1 fullsim MC | ||
std::string label = ""; // the correct default | ||
|
||
if( theMagField>=-0.1 && theMagField<1.0 ) label = "0T"; | ||
else if(theMagField>=1.0 && theMagField<2.5 ) label = "2T"; | ||
else if(theMagField>=2.5 && theMagField<3.25) label = "3T"; | ||
else if(theMagField>=3.25 && theMagField<3.65) label = "35T"; | ||
else if(theMagField>=3.9 && theMagField<4.1 ) label = "4T"; | ||
else { | ||
//label = "3.8T"; | ||
if(theMagField>=4.1 || theMagField<-0.1) edm::LogWarning("UnexpectedMagneticFieldUsingDefaultPixel2DTemplate") << "Magnetic field is " << theMagField; | ||
} | ||
ESHandle<SiPixel2DTemplateDBObject> dbobject; | ||
iRecord.getRecord<SiPixel2DTemplateDBObjectRcd>().get(label,dbobject); | ||
|
||
if(std::fabs(theMagField-dbobject->sVector()[22])>0.1) | ||
edm::LogWarning("UnexpectedMagneticFieldUsingNonIdealPixel2DTemplate") << "Magnetic field is " << theMagField << " Template Magnetic field is " << dbobject->sVector()[22]; | ||
|
||
return std::shared_ptr<SiPixel2DTemplateDBObject>(const_cast<SiPixel2DTemplateDBObject*>(&(*dbobject)), edm::do_nothing_deleter()); | ||
} | ||
|
||
DEFINE_FWK_EVENTSETUP_MODULE(SiPixel2DTemplateDBObjectESProducer); |
4 changes: 4 additions & 0 deletions
4
CalibTracker/SiPixelESProducers/python/SiPixel2DTemplateDBObjectESProducer_cfi.py
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 | ||
|
||
siPixel2DTemplateDBObjectESProducer = cms.ESProducer("SiPixel2DTemplateDBObjectESProducer") | ||
|
Oops, something went wrong.