Skip to content

Commit

Permalink
Merge pull request #8 from cms-sw/CMSSW_7_5_X
Browse files Browse the repository at this point in the history
PRToFixMess_IdealGeometry2015Muon_PR_v1
  • Loading branch information
pietverwilligen committed May 22, 2015
2 parents 32e7dc8 + a96732c commit ccc24a7
Show file tree
Hide file tree
Showing 100 changed files with 4,325 additions and 1,615 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ def __init__(self, name, config, runGeomComp = "1"):
self.condShorts = {
"TrackerAlignmentErrorExtendedRcd":
{"zeroAPE":{"connectString": ("frontier://FrontierProd"
"/CMS_COND_31X_FROM21X"),
"tagName": "TrackerIdealGeometryErrors210_mc",
"/CMS_CONDITIONS"),
"tagName": "TrackerAlignmentExtendedErr_2009_v2_express_IOVs",

"labelName": ""}}}
section = "alignment:%s"%name
if not config.has_section( section ):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
cd .oO[CMSSW_BASE]Oo./src
export SCRAM_ARCH=.oO[SCRAM_ARCH]Oo.
eval `scramv1 ru -sh`
rfmkdir -p .oO[datadir]Oo. &>! /dev/null
#rfmkdir -p .oO[datadir]Oo. &>! /dev/null
#remove possible result file from previous runs
previous_results=$(cmsLs -l /store/caf/user/$USER/.oO[eosdir]Oo. | awk '{print $5}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def getRepMap(self, alignment = None):
"CMSSW_RELEASE_BASE": self.cmsswreleasebase,
"alignmentName": alignment.name,
"condLoad": alignment.getConditions(),
"condLoad": alignment.getConditions(),
})
return result

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
process.load("Configuration.Geometry.GeometryDB_cff")
#process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi")
#process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
process.load('Configuration.Geometry.GeometryExtended2015_cff')
process.TrackerTopologyEP = cms.ESProducer("TrackerTopologyEP")
process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
#process.load("Alignment.CommonAlignmentProducer.GlobalPosition_Frontier_cff")
process.load("CondCore.DBCommon.CondDBSetup_cfi")
process.MessageLogger = cms.Service("MessageLogger",
Expand All @@ -31,7 +31,6 @@
input = cms.untracked.int32(1)
)
process.dump = cms.EDAnalyzer("TrackerGeometryIntoNtuples",
# outputFile = cms.untracked.string('.oO[workdir]Oo./.oO[alignmentName]Oo.ROOTGeometry.root'),
outputFile = cms.untracked.string('.oO[alignmentName]Oo.ROOTGeometry.root'),
outputTreename = cms.untracked.string('alignTree')
)
Expand All @@ -50,15 +49,11 @@
# global tag
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
process.load("Configuration.Geometry.GeometryDB_cff")
#process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi")
#process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
process.load('Configuration.Geometry.GeometryExtended2015_cff')
process.TrackerTopologyEP = cms.ESProducer("TrackerTopologyEP")
#process.load("Alignment.CommonAlignmentProducer.GlobalPosition_Frontier_cff")
# the input .GlobalPosition_Frontier_cff is providing the frontier://FrontierProd/CMS_COND_31X_ALIGNMENT in the release which does not provide the ideal geometry
#process.GlobalPosition.connect = 'frontier://FrontierProd/CMS_COND_31X_FROM21X'
process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
process.load("CondCore.DBCommon.CondDBSetup_cfi")
Expand All @@ -76,11 +71,8 @@
process.load("DQM.SiStripCommon.TkHistoMap_cfi")
process.DQMStore=cms.Service("DQMStore")
#process.TkDetMap = cms.Service("TkDetMap")
#process.SiStripDetInfoFileReader = cms.Service("SiStripDetInfoFileReader")
process.load("DQMServices.Core.DQMStore_cfg")
#process.DQMStore=cms.Service("DQMStore")
# configuration of the Tracker Geometry Comparison Tool
# Tracker Geometry Comparison
Expand All @@ -89,13 +81,9 @@
process.TrackerGeometryCompare.inputROOTFile1 = '.oO[comparedGeometry]Oo.'
process.TrackerGeometryCompare.inputROOTFile2 = '.oO[referenceGeometry]Oo.'
# process.TrackerGeometryCompare.outputFile = ".oO[workdir]Oo./.oO[name]Oo..Comparison_common.oO[common]Oo..root"
process.TrackerGeometryCompare.outputFile = ".oO[name]Oo..Comparison_common.oO[common]Oo..root"
process.load("CommonTools.UtilAlgos.TFileService_cfi")
#process.TFileService = cms.Service("TFileService",
# fileName = cms.string('TkSurfDeform.root')
# )
process.TFileService.fileName = cms.string("TkSurfDeform_.oO[name]Oo..Comparison_common.oO[common]Oo..root")
process.TrackerGeometryCompare.levels = [ .oO[levels]Oo. ]
Expand All @@ -113,7 +101,7 @@
dbOutputTemplate= """
//_________________________ db Output ____________________________
# setup for writing out to DB
include "CondCore/DBCommon/data/CondDBSetup.cfi"
include "CondCore/DBCommon/CondDBSetup.cfi"
# include "CondCore/DBCommon/data/CondDBCommon.cfi"
service = PoolDBOutputService {
Expand Down
69 changes: 56 additions & 13 deletions Alignment/OfflineValidation/scripts/comparisonScript.C
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,68 @@ void comparisonScript (TString inFile,//="mp1510_vs_mp1509.Comparison_commonTrac
// from r and dphi

// now the object to produce the comparison plots is created
GeometryComparisonPlotter * cp = new GeometryComparisonPlotter (inFile, outDir);

// Plot Translations
GeometryComparisonPlotter * trans = new GeometryComparisonPlotter (inFile, outDir);
// x and y contain the couples to plot
// -> every combination possible will be performed
// /!\ always give units (otherwise, unexpected bug from root...)
vector<TString> x,y;
x.push_back("r"); cp->SetBranchUnits("r", "cm");
x.push_back("phi"); cp->SetBranchUnits("phi", "rad");
x.push_back("z"); cp->SetBranchUnits("z", "cm"); //cp->SetBranchMax("z", 100); cp->SetBranchMin("z", -100);
y.push_back("dr"); cp->SetBranchSF("dr", 10000); cp->SetBranchUnits("dr", "#mum");
y.push_back("dz"); cp->SetBranchSF("dz", 10000); cp->SetBranchUnits("dz", "#mum");
y.push_back("rdphi"); cp->SetBranchSF("rdphi",10000); cp->SetBranchUnits("rdphi", "#mum rad");
y.push_back("dx"); cp->SetBranchSF("dx", 10000); cp->SetBranchUnits("dx", "#mum"); //cp->SetBranchMax("dx", 10); cp->SetBranchMin("dx", -10);
y.push_back("dy"); cp->SetBranchSF("dy", 10000); cp->SetBranchUnits("dy", "#mum"); //cp->SetBranchMax("dy", 10); cp->SetBranchMin("dy", -10);
cp->MakePlots(x, y); // default output is pdf, but png gives a nicer result, so we use it as well
x.push_back("r"); trans->SetBranchUnits("r", "cm");
x.push_back("phi"); trans->SetBranchUnits("phi", "rad");
x.push_back("z"); trans->SetBranchUnits("z", "cm"); //trans->SetBranchMax("z", 100); trans->SetBranchMin("z", -100);
y.push_back("dr"); trans->SetBranchSF("dr", 10000); trans->SetBranchUnits("dr", "#mum");
y.push_back("dz"); trans->SetBranchSF("dz", 10000); trans->SetBranchUnits("dz", "#mum");
y.push_back("rdphi"); trans->SetBranchSF("rdphi",10000); trans->SetBranchUnits("rdphi", "#mum rad");
y.push_back("dx"); trans->SetBranchSF("dx", 10000); trans->SetBranchUnits("dx", "#mum"); //trans->SetBranchMax("dx", 10); trans->SetBranchMin("dx", -10);
y.push_back("dy"); trans->SetBranchSF("dy", 10000); trans->SetBranchUnits("dy", "#mum"); //trans->SetBranchMax("dy", 10); trans->SetBranchMin("dy", -10);
trans->MakePlots(x, y); // default output is pdf, but png gives a nicer result, so we use it as well
// remark: what takes the more time is the creation of the output files,
// not the looping on the tree (because the code is perfect, of course :p)
cp->SetGrid(1,1);
cp->SetPrintOption("png");
cp->MakePlots(x, y);
trans->SetGrid(1,1);
trans->SetPrintOption("png");
trans->MakePlots(x, y);


// Plot Rotations
GeometryComparisonPlotter * rot = new GeometryComparisonPlotter (inFile, outDir);
// x and y contain the couples to plot
// -> every combination possible will be performed
// /!\ always give units (otherwise, unexpected bug from root...)
vector<TString> a,b;
a.push_back("alpha"); rot->SetBranchUnits("alpha", "rad");
a.push_back("beta"); rot->SetBranchUnits("beta", "rad");
a.push_back("gamma"); rot->SetBranchUnits("gamma", "rad");
b.push_back("dalpha"); rot->SetBranchUnits("dalpha", "rad");
b.push_back("dbeta"); rot->SetBranchUnits("dbeta", "rad");
b.push_back("dgamma"); rot->SetBranchUnits("dgamma", "rad");
rot->MakePlots(a, b); // default output is pdf, but png gives a nicer result, so we use it as well
// remark: what takes the more time is the creation of the output files,
// not the looping on the tree (because the code is perfect, of course :p)
rot->SetGrid(1,1);
rot->SetPrintOption("png");
rot->MakePlots(a, b);

// Plot cross talk
GeometryComparisonPlotter * cross = new GeometryComparisonPlotter (inFile, outDir);
// x and y contain the couples to plot
// -> every combination possible will be performed
// /!\ always give units (otherwise, unexpected bug from root...)
vector<TString> dx,dy;
dx.push_back("dr"); cross->SetBranchSF("dr", 10000); cross->SetBranchUnits("dr", "#mum");
dx.push_back("dz"); cross->SetBranchSF("dz", 10000); cross->SetBranchUnits("dz", "#mum");
dx.push_back("rdphi"); cross->SetBranchSF("rdphi",10000); cross->SetBranchUnits("rdphi", "#mum rad");
dx.push_back("dx"); cross->SetBranchSF("dx", 10000); cross->SetBranchUnits("dx", "#mum");
dx.push_back("dy"); cross->SetBranchSF("dy", 10000); cross->SetBranchUnits("dy", "#mum");
dy.push_back("dalpha"); cross->SetBranchUnits("dalpha", "rad");
dy.push_back("dbeta"); cross->SetBranchUnits("dbeta", "rad");
dy.push_back("dgamma"); cross->SetBranchUnits("dgamma", "rad");
cross->MakePlots(dx,dy); // default output is pdf, but png gives a nicer result, so we use it as well
// remark: what takes the more time is the creation of the output files,
// not the looping on the tree (because the code is perfect, of course :p)
cross->SetGrid(1,1);
cross->SetPrintOption("png");
cross->MakePlots(dx, dy);

// now the same object can be reused with other specifications/cuts
//void SetPrint (const bool); // activates the printing of the individual and global pdf
Expand Down
17 changes: 6 additions & 11 deletions Alignment/OfflineValidation/scripts/makeArrowPlots.C
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ float y_,x_,z_,phi_,r_,dphi_,dr_,dx_,dz_,dy_;
int level_,sublevel_;
char outputDir_[192];

void Plot10Mu(char* text,float X, float Y, float size)
void Plot10Mu(const char* text,float X, float Y, float size)
{
TPaveText* atext = new TPaveText(X,Y,X+size,Y+size);
atext->AddText(text);
Expand Down Expand Up @@ -48,13 +48,8 @@ void DrawRPhiLegend(double xLim, double yLim, double barrelRPhiRescale)
normArrow(xTest+dYTest,yTest-4*dYTest-disty,500./10000*barrelRPhiRescale);
}

void Write()
{
output->Write();
}


int makeRPhiArrowPlot( TTree* data, char* name, double xLim, double yLim, double level, double sublevel, double zMin, double zMax, double rMin, double rMax, double barrelRPhiRescale){
int makeRPhiArrowPlot( TTree* data, const char* name, double xLim, double yLim, double level, double sublevel, double zMin, double zMax, double rMin, double rMax, double barrelRPhiRescale){


TCanvas* OBPCanvas = new TCanvas(name,name,1050,875);
Expand All @@ -80,7 +75,7 @@ int makeRPhiArrowPlot( TTree* data, char* name, double xLim, double yLim, double
DrawRPhiLegend( xLim, yLim, barrelRPhiRescale );

char sliceLeg[192];
sprintf( sliceLeg, "%s: %d < z <= %d", name, zMin, zMax );
sprintf( sliceLeg, "%s: %f < z <= %f", name, zMin, zMax );
//Plot10Mu( name, xLim/2, yLim, 0.2*xLim );
TPaveText* atext = new TPaveText(0.2*xLim,0.85*yLim,0.66*xLim,0.99*yLim);
atext->AddText(sliceLeg);
Expand All @@ -99,7 +94,7 @@ int makeRPhiArrowPlot( TTree* data, char* name, double xLim, double yLim, double
return passcut;
}

int makeZPhiArrowPlot( TTree* data, char* name, double zLim, double phiLim, double level, double sublevel, double zMin, double zMax, double rMin, double rMax, double barrelRPhiRescale){
int makeZPhiArrowPlot( TTree* data, const char* name, double zLim, double phiLim, double level, double sublevel, double zMin, double zMax, double rMin, double rMax, double barrelRPhiRescale){


TCanvas* OBPCanvas = new TCanvas(name,name,1050,875);
Expand All @@ -125,7 +120,7 @@ int makeZPhiArrowPlot( TTree* data, char* name, double zLim, double phiLim, doub
DrawRPhiLegend( zLim, phiLim, barrelRPhiRescale );

char sliceLeg[192];
sprintf( sliceLeg, "%s: %d < r <= %d", name, rMin, rMax );
sprintf( sliceLeg, "%s: %f < r <= %f", name, rMin, rMax );
//Plot10Mu( name, xLim/2, yLim, 0.2*xLim );
TPaveText* atext = new TPaveText(0.2*zLim,0.85*phiLim,0.66*zLim,0.99*phiLim);
atext->AddText(sliceLeg);
Expand Down Expand Up @@ -198,7 +193,7 @@ int makeRZArrowPlot( TTree* data, char* name, double zLim, double zLimMax, doubl
}
*/

void makeArrowPlots(char* filename, char* outputDir)
void makeArrowPlots(const char* filename, const char* outputDir)
{

fin = new TFile(filename);
Expand Down
10 changes: 6 additions & 4 deletions Calibration/HcalCalibAlgos/src/GammaJetAnalysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ unsigned int helper_findTrigger(const std::vector<std::string>& list,

// -------------------------------------------------

GammaJetAnalysis::GammaJetAnalysis(const edm::ParameterSet& iConfig) {
GammaJetAnalysis::GammaJetAnalysis(const edm::ParameterSet& iConfig) :
hltPrescaleProvider_(iConfig, consumesCollector(), *this) {

// set parameters
debug_ = iConfig.getUntrackedParameter<int>("debug", 0);
debugHLTTrigNames = iConfig.getUntrackedParameter<int>("debugHLTTrigNames",1);
Expand Down Expand Up @@ -353,7 +355,7 @@ void GammaJetAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup&
if (!writeTriggerPrescale_) photonTrigPrescale_.push_back(-1);
else {
// for triggers with two L1 seeds this fails
std::pair<int,int> prescaleVals= hltConfig_.prescaleValues(iEvent,evSetup, evTrigNames.triggerName(id));
std::pair<int,int> prescaleVals= hltPrescaleProvider_.prescaleValues(iEvent,evSetup, evTrigNames.triggerName(id));
photonTrigPrescale_.push_back(prescaleVals.first * prescaleVals.second);
}
}
Expand All @@ -368,7 +370,7 @@ void GammaJetAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup&
int fired= triggerResults->accept(id);
if (fired) jetTrigFlag=true;
jetTrigFired_.push_back(fired);
std::pair<int,int> prescaleVals= hltConfig_.prescaleValues(iEvent,evSetup,evTrigNames.triggerName(id));
std::pair<int,int> prescaleVals = hltPrescaleProvider_.prescaleValues(iEvent,evSetup,evTrigNames.triggerName(id));
jetTrigPrescale_.push_back(prescaleVals.first * prescaleVals.second);
}
}
Expand Down Expand Up @@ -1594,7 +1596,7 @@ void GammaJetAnalysis::beginRun(const edm::Run &iRun,
if (debug_>0) edm::LogInfo("GammaJetAnalysis") << "Initializing trigger information for individual run";
bool changed(true);
std::string processName="HLT";
if (hltConfig_.init(iRun,setup,processName,changed)) {
if (hltPrescaleProvider_.init(iRun,setup,processName,changed)) {
// if init returns TRUE, initialisation has succeeded!
if (changed) {
// The HLT config has actually changed wrt the previous Run, hence rebook your
Expand Down
4 changes: 2 additions & 2 deletions Calibration/HcalCalibAlgos/src/GammaJetAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"

#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
#include "HLTrigger/HLTcore/interface/HLTPrescaleProvider.h"

// forward declarations
class TH1D;
Expand Down Expand Up @@ -200,7 +200,7 @@ class GammaJetAnalysis : public edm::EDAnalyzer {
TTree* pf_tree_;

// trigger info
HLTConfigProvider hltConfig_; // variable for the access
HLTPrescaleProvider hltPrescaleProvider_;
std::vector<int> photonTrigFired_;
std::vector<int> photonTrigPrescale_;
std::vector<int> jetTrigFired_;
Expand Down
19 changes: 12 additions & 7 deletions Calibration/IsolatedParticles/plugins/IsoTrackCalib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
#include "DataFormats/Math/interface/deltaR.h"
#include "DataFormats/Math/interface/deltaPhi.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"

IsoTrackCalib::IsoTrackCalib(const edm::ParameterSet& iConfig) :
changed(false), nRun(0), t_trackP(0), t_trackPx(0), t_trackPy(0),
changed(false),
hltPrescaleProvider_(iConfig, consumesCollector(), *this),
nRun(0), t_trackP(0), t_trackPx(0), t_trackPy(0),
t_trackPz(0), t_trackEta(0), t_trackPhi(0), t_trackPt(0), t_neu_iso(0),
t_charge_iso(0), t_emip(0), t_ehcal(0), t_trkL3mindr(0), t_ieta(0),
t_disthotcell(0), t_ietahotcell(0), t_eventweight(0), t_l1pt(0), t_l1eta(0),
Expand Down Expand Up @@ -132,6 +135,8 @@ void IsoTrackCalib::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe
<< " Bunch " << iEvent.bunchCrossing() << " start";
clearTreeVectors();

HLTConfigProvider const& hltConfig = hltPrescaleProvider_.hltConfigProvider();

//Get magnetic field and ECAL channel status
edm::ESHandle<MagneticField> bFieldH;
iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
Expand Down Expand Up @@ -214,8 +219,8 @@ void IsoTrackCalib::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe
const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
bool ok(false);
unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[iHLT]);
const std::vector<std::string>& moduleLabels(hltConfig_.moduleLabels(triggerindx));
unsigned int triggerindx = hltConfig.triggerIndex(triggerNames_[iHLT]);
const std::vector<std::string>& moduleLabels(hltConfig.moduleLabels(triggerindx));
edm::LogInfo("IsoTrack") << iHLT << " " <<triggerNames_[iHLT];
int ipos = -1;
for (unsigned int i=0; i<HLTNames.size(); ++i) {
Expand Down Expand Up @@ -249,7 +254,7 @@ void IsoTrackCalib::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe
edm::LogInfo("IsoTrack") << "Trigger fired? : " << ok;
if (ok) {
std::vector<math::XYZTLorentzVector> vec[3];
const std::pair<int,int> prescales(hltConfig_.prescaleValues(iEvent,iSetup,triggerNames_[iHLT]));
const std::pair<int,int> prescales(hltPrescaleProvider_.prescaleValues(iEvent,iSetup,triggerNames_[iHLT]));
int preL1 = prescales.first;
int preHLT = prescales.second;
int prescale = preL1*preHLT;
Expand Down Expand Up @@ -471,9 +476,9 @@ void IsoTrackCalib::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe
changed = false;
if ((verbosity/10)%10 > 1) {
edm::LogInfo("IsoTrack") <<"New trigger menu found !!!";
const unsigned int n(hltConfig_.size());
const unsigned int n(hltConfig.size());
for (unsigned itrig=0; itrig<triggerNames_.size(); itrig++) {
unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[itrig]);
unsigned int triggerindx = hltConfig.triggerIndex(triggerNames_[itrig]);
if (triggerindx >= n)
edm::LogInfo("IsoTrack") << triggerNames_[itrig] << " "
<< triggerindx << " does not exist";
Expand Down Expand Up @@ -573,7 +578,7 @@ void IsoTrackCalib::endJob() {
// ------------ method called when starting to processes a run ------------
void IsoTrackCalib::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) {
edm::LogInfo("IsoTrack") << "Run[" << nRun <<"] " << iRun.run()
<< " hltconfig.init " << hltConfig_.init(iRun,iSetup,"HLT",changed);
<< " hltconfig.init " << hltPrescaleProvider_.init(iRun,iSetup,"HLT",changed);
char hname[100], htit[100];
sprintf(hname, "h_HLTAccepts_%i", iRun.run());
sprintf(htit, "HLT Accepts for Run No %i", iRun.run());
Expand Down
Loading

0 comments on commit ccc24a7

Please sign in to comment.