Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsunanda:Run2-alca8 Latest changes to meet calibration codes for HCAL #8745

Merged
merged 1 commit into from Apr 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 20 additions & 21 deletions Calibration/HcalAlCaRecoProducers/src/AlCaGammaJetProducer.cc
Expand Up @@ -104,9 +104,9 @@ AlCaGammaJetProducer::AlCaGammaJetProducer(const edm::ParameterSet& iConfig) : n
tok_loosePhoton_ = consumes<edm::ValueMap<Bool_t> >(labelLoosePhot_);
tok_tightPhoton_ = consumes<edm::ValueMap<Bool_t> >(labelTightPhot_);
tok_GsfElec_ = consumes<reco::GsfElectronCollection>(labelGsfEle_);
tok_Rho_ = consumes<double>(labelRho_);
tok_Conv_ = consumes<reco::ConversionCollection>(labelConv_);
tok_BS_ = consumes<reco::BeamSpot>(labelBeamSpot_);
tok_Rho_ = consumes<double>(labelRho_);
tok_Conv_ = consumes<reco::ConversionCollection>(labelConv_);
tok_BS_ = consumes<reco::BeamSpot>(labelBeamSpot_);

// register your products
produces<reco::PhotonCollection>(labelPhoton_.encode());
Expand Down Expand Up @@ -275,7 +275,6 @@ void AlCaGammaJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iS
std::auto_ptr<std::vector<Bool_t> > miniLoosePhoton(new std::vector<Bool_t>());
std::auto_ptr<std::vector<Bool_t> > miniTightPhoton(new std::vector<Bool_t>());


// See if this event is useful
bool accept = select(photon, pfjets);
if (accept) {
Expand Down Expand Up @@ -355,24 +354,24 @@ void AlCaGammaJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iS
}
}
}
}

//Put them in the event
iEvent.put( miniPhotonCollection, labelPhoton_.encode());
iEvent.put( miniPFjetCollection, labelPFJet_.encode());
iEvent.put( miniHBHECollection, labelHBHE_.encode());
iEvent.put( miniHFCollection, labelHF_.encode());
iEvent.put( miniHOCollection, labelHO_.encode());
iEvent.put( miniTriggerCollection, labelTrigger_.encode());
iEvent.put( miniPFCandCollection, labelPFCandidate_.encode());
iEvent.put( miniVtxCollection, labelVertex_.encode());
iEvent.put( miniPFMETCollection, labelPFMET_.encode());
iEvent.put( miniGSFeleCollection, labelGsfEle_.encode());
iEvent.put( miniRhoCollection, labelRho_.encode());
iEvent.put( miniConversionCollection, labelConv_.encode());
iEvent.put( miniBeamSpotCollection, labelBeamSpot_.encode());
iEvent.put( miniLoosePhoton, labelLoosePhot_.encode());
iEvent.put( miniTightPhoton, labelTightPhot_.encode());
//Put them in the event
iEvent.put( miniPhotonCollection, labelPhoton_.encode());
iEvent.put( miniPFjetCollection, labelPFJet_.encode());
iEvent.put( miniHBHECollection, labelHBHE_.encode());
iEvent.put( miniHFCollection, labelHF_.encode());
iEvent.put( miniHOCollection, labelHO_.encode());
iEvent.put( miniTriggerCollection, labelTrigger_.encode());
iEvent.put( miniPFCandCollection, labelPFCandidate_.encode());
iEvent.put( miniVtxCollection, labelVertex_.encode());
iEvent.put( miniPFMETCollection, labelPFMET_.encode());
iEvent.put( miniGSFeleCollection, labelGsfEle_.encode());
iEvent.put( miniRhoCollection, labelRho_.encode());
iEvent.put( miniConversionCollection, labelConv_.encode());
iEvent.put( miniBeamSpotCollection, labelBeamSpot_.encode());
iEvent.put( miniLoosePhoton, labelLoosePhot_.encode());
iEvent.put( miniTightPhoton, labelTightPhot_.encode());
}

return;

Expand Down
103 changes: 54 additions & 49 deletions Calibration/HcalCalibAlgos/src/GammaJetAnalysis.cc

Large diffs are not rendered by default.

77 changes: 65 additions & 12 deletions Calibration/HcalCalibAlgos/test/gammaJetAnalysis_cfg.py
@@ -1,13 +1,66 @@
import FWCore.ParameterSet.Config as cms
process = cms.Process('ANALYSIS')

process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.StandardSequences.Services_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsunanda
please change this to process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff') in order to consume conditions from the new backend. The old one is decommissioned.


#process.MessageLogger.messages = cms.untracked.PSet(
# threshold = cms.untracked.vstring('DEBUG')
#)
process.MessageLogger = cms.Service("MessageLogger",
destinations = cms.untracked.vstring('warnings','errors',
'cout','cerr'),
categories = cms.untracked.vstring('GammaJetAnalysis'),
debugModules = cms.untracked.vstring('*'),
warnings = cms.untracked.PSet(
placeholder = cms.untracked.bool(True)
),
default = cms.untracked.PSet(

),
errors = cms.untracked.PSet(
placeholder = cms.untracked.bool(True)
),
cerr = cms.untracked.PSet(
optionalPSet = cms.untracked.bool(True),
INFO = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
noTimeStamps = cms.untracked.bool(False),
FwkReport = cms.untracked.PSet(
optionalPSet = cms.untracked.bool(True),
reportEvery = cms.untracked.int32(500),
limit = cms.untracked.int32(10000000)
),
default = cms.untracked.PSet(
limit = cms.untracked.int32(10000000)
),
Root_NoDictionary = cms.untracked.PSet(
optionalPSet = cms.untracked.bool(True),
limit = cms.untracked.int32(0)
),
FwkJob = cms.untracked.PSet(
optionalPSet = cms.untracked.bool(True),
limit = cms.untracked.int32(0)
),
FwkSummary = cms.untracked.PSet(
optionalPSet = cms.untracked.bool(True),
reportEvery = cms.untracked.int32(1),
limit = cms.untracked.int32(10000000)
),
threshold = cms.untracked.string('INFO')
),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('INFO'),
noTimeStamps = cms.untracked.bool(True),
INFO = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
DEBUG = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
GammaJetAnalysis = cms.untracked.PSet(
limit = cms.untracked.int32(-1)
)
)
)

process.load("Configuration.Geometry.GeometryIdeal_cff")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsunanda
please change this to process.load("Configuration.StandardSequences.GeometryRecoDB_cff")as explained here

process.load("MagneticField.Engine.autoMagneticFieldProducer_cfi")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here, please move to condDBv2:

from Configuration.AlCa.autoCond_condDBv2 import autoCond
 process.GlobalTag.globaltag=autoCond['run2_mc']

Expand Down Expand Up @@ -51,16 +104,15 @@

process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'file:gjet.root'
# '/store/relval/CMSSW_7_3_0/RelValPhotonJets_Pt_10_13/GEN-SIM-RECO/MCRUN2_73_V7-v1/00000/522CE329-7B81-E411-B6C3-0025905A6110.root',
# '/store/relval/CMSSW_7_3_0/RelValPhotonJets_Pt_10_13/GEN-SIM-RECO/MCRUN2_73_V7-v1/00000/5279D224-7B81-E411-BCAA-002618943930.root'
'file:../../HcalAlCaRecoProducers/test/gjet.root'
# '/store/relval/CMSSW_7_3_0/RelValPhotonJets_Pt_10_13/GEN-SIM-RECO/MCRUN2_73_V7-v1/00000/522CE329-7B81-E411-B6C3-0025905A6110.root'
# '/store/relval/CMSSW_7_4_0_pre6/RelValPhotonJets_Pt_10_13/GEN-SIM-RECO/MCRUN2_74_V1-v1/00000/6EC8FCC8-E2A8-E411-9506-002590596468.root'
)
)

process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
#process.MessageLogger.cerr.threshold = cms.untracked.string('DEBUG') # does not work?
process.MessageLogger.cerr.FwkReport.reportEvery=cms.untracked.int32(500)
process.MessageLogger.cerr.FwkReport.reportEvery=cms.untracked.int32(1)
process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) )

# Load pfNoPileUP
Expand All @@ -72,11 +124,12 @@
#)

#process.load('Calibration.HcalCalibAlgos.gammaJetAnalysis_CHSJECs_cff')

# name of the process that used the GammaJetProd producer
process.GammaJetAnalysis.prodProcess = 'MYGAMMAJET'
# specify 'workOnAOD=2' to apply tokens from GammaJetProd producer
process.GammaJetAnalysis.workOnAOD = cms.int32(2)
process.GammaJetAnalysis.doGenJets = cms.bool(False)
process.GammaJetAnalysis.debug = cms.untracked.int32(1)
process.GammaJetAnalysis.workOnAOD = 2
process.GammaJetAnalysis.doGenJets = False
process.GammaJetAnalysis.debug = 2

process.p = cms.Path(
# process.PF2PAT
Expand Down
4 changes: 4 additions & 0 deletions Calibration/IsolatedParticles/interface/eHCALMatrix.h
Expand Up @@ -27,8 +27,11 @@ Created: August 2009
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
#include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"

#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloTopology/interface/HcalTopology.h"

namespace spr{
Expand Down Expand Up @@ -71,6 +74,7 @@ namespace spr{

HcalDetId getHotCell(std::vector<HBHERecHitCollection::const_iterator>& hit, bool& includeHO, bool& debug);

HcalDetId getHotCell(std::vector<std::vector<PCaloHit>::const_iterator>& hit, bool& includeHO, bool& debug);
}

#include "Calibration/IsolatedParticles/interface/eHCALMatrix.icc"
Expand Down
34 changes: 0 additions & 34 deletions Calibration/IsolatedParticles/interface/eHCALMatrix.icc
Expand Up @@ -260,39 +260,5 @@ namespace spr{

if (debug) std::cout << "hitsHCAL::Number of hits " << hitlist.size() << std::endl;
}

HcalDetId getHotCell(std::vector<HBHERecHitCollection::const_iterator>& hit, bool& includeHO, bool& debug) {

std::vector<HcalDetId> dets;
std::vector<double> energies;
for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
double energy = getEnergy(hit.at(ihit));
HcalDetId id0 = hit.at(ihit)->id();
if ((id0.subdet() != HcalOuter) || includeHO) {
HcalDetId id1(id0.subdet(),id0.ieta(),id0.iphi(),1);
bool found(false);
for (unsigned int idet=0; idet<dets.size(); ++idet) {
if (id1 == dets[idet]) {
energies[idet] += energy;
found = true;
break;
}
}
if (!found) {
dets.push_back(id1);
energies.push_back(energy);
}
}
}
double energyMax(-99.);
HcalDetId hotCell;
for (unsigned int ihit=0; ihit<dets.size(); ihit++) {
if (energies[ihit] > energyMax) {
energyMax = energies[ihit];
hotCell = dets[ihit];
}
}
return hotCell;
}
}

1 change: 1 addition & 0 deletions Calibration/IsolatedParticles/plugins/BuildFile.xml
Expand Up @@ -48,3 +48,4 @@
<library name="CalibrationIsoTrig" file="IsoTrig.cc"> </library>
<library name="CalibrationIsoTrackCalib" file="IsoTrackCalib.cc"> </library>
<library name="CalibrationIsoTrackCalibration" file="IsoTrackCalibration.cc"> </library>
<library name="CalibrationHcalRaddamMuon" file="HcalRaddamMuon.cc"> </library>