Skip to content

Commit

Permalink
Merge pull request #9062 from bsunanda/Run2-alca14
Browse files Browse the repository at this point in the history
bsunanda:Run2 alca14 Get rid of unused variables and avoid explicit names
  • Loading branch information
cmsbuild committed May 19, 2015
2 parents 43fb720 + b7c52a2 commit de9a9ff
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 224 deletions.
1 change: 1 addition & 0 deletions Calibration/HcalAlCaRecoProducers/python/alcaisotrk_cfi.py
Expand Up @@ -11,6 +11,7 @@
L1GTSeedLabel = cms.InputTag("hltL1sL1SingleJet68"),
TriggerEventLabel = cms.InputTag("hltTriggerSummaryAOD","","HLT"),
TriggerResultLabel= cms.InputTag("TriggerResults","","HLT"),
IsoTrackLabel = cms.string("HcalIsolatedTrackCollection"),
Triggers = cms.vstring("HLT_IsoTrackHB","HLT_IsoTrackHE"),
TrackQuality = cms.string("highPurity"),
ProcessName = cms.string("HLT"),
Expand Down
68 changes: 40 additions & 28 deletions Calibration/HcalAlCaRecoProducers/src/AlCaGammaJetProducer.cc
Expand Up @@ -47,7 +47,7 @@ class AlCaGammaJetProducer : public edm::EDProducer {
virtual void endJob();

private:
bool select (reco::PhotonCollection, reco::PFJetCollection);
bool select(const reco::PhotonCollection&, const reco::PFJetCollection&);

// ----------member data ---------------------------

Expand Down 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 @@ -135,13 +135,24 @@ void AlCaGammaJetProducer::endJob() {
edm::LogInfo("AlcaGammaJet") << "Accepts " << nSelect_ << " events from a total of " << nAll_ << " events";
}

bool AlCaGammaJetProducer::select (reco::PhotonCollection ph, reco::PFJetCollection jt) {

if (jt.size()<1) return false;
if (ph.size()<1) return false;
if (((jt.at(0)).pt())<minPtJet_) return false;
if (((ph.at(0)).pt())<minPtPhoton_) return false;
return true;
bool AlCaGammaJetProducer::select (const reco::PhotonCollection &ph, const reco::PFJetCollection &jt) {

// Check the requirement for minimum pT
if (ph.size() == 0) return false;
bool ok(false);
for (reco::PFJetCollection::const_iterator itr=jt.begin();
itr!=jt.end(); ++itr) {
if (itr->pt() >= minPtJet_) {
ok = true;
break;
}
}
if (!ok) return ok;
for (reco::PhotonCollection::const_iterator itr=ph.begin();
itr!=ph.end(); ++itr) {
if (itr->pt() >= minPtPhoton_) return ok;
}
return false;
}
// ------------ method called to produce the data ------------
void AlCaGammaJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
Expand Down Expand Up @@ -275,6 +286,7 @@ 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 @@ -354,25 +366,25 @@ 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
8 changes: 4 additions & 4 deletions Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc
Expand Up @@ -95,8 +95,8 @@ AlCaHBHEMuonProducer::AlCaHBHEMuonProducer(const edm::ParameterSet& iConfig) :
//saves the following collections
produces<reco::BeamSpot>(labelBS_.label());
produces<reco::VertexCollection>(labelVtx_.label());
produces<EcalRecHitCollection>("EcalRecHitsEB");
produces<EcalRecHitCollection>("EcalRecHitsEE");
produces<EcalRecHitCollection>(labelEB_.instance());
produces<EcalRecHitCollection>(labelEE_.instance());
produces<HBHERecHitCollection>(labelHBHE_.label());
produces<reco::MuonCollection>(labelMuon_.label());
}
Expand Down Expand Up @@ -199,8 +199,8 @@ void AlCaHBHEMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iS

iEvent.put(outputBeamSpot, labelBS_.label());
iEvent.put(outputVColl, labelVtx_.label());
iEvent.put(outputEBColl, "EcalRecHitsEB");
iEvent.put(outputEEColl, "EcalRecHitsEE");
iEvent.put(outputEBColl, labelEB_.instance());
iEvent.put(outputEEColl, labelEE_.instance());
iEvent.put(outputHBHEColl, labelHBHE_.label());
iEvent.put(outputMColl, labelMuon_.label());
}
Expand Down
23 changes: 13 additions & 10 deletions Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc
Expand Up @@ -104,7 +104,8 @@ class AlCaIsoTracksProducer : public edm::EDProducer {
int nRun, nAll, nGood;
edm::InputTag labelTriggerEvent_, labelTriggerResults_;
edm::InputTag labelGenTrack_, labelRecVtx_, labelHltGT_;
edm::InputTag labelEB_, labelEE_, labelHBHE_;
edm::InputTag labelEB_, labelEE_, labelHBHE_, labelBS_;
std::string labelIsoTk_;
const MagneticField *bField;
const CaloGeometry *geo;
double ptL1, etaL1, phiL1;
Expand Down Expand Up @@ -149,20 +150,22 @@ AlCaIsoTracksProducer::AlCaIsoTracksProducer(const edm::ParameterSet& iConfig) :
eIsolation_ = iConfig.getParameter<double>("IsolationEnergy");
labelGenTrack_ = iConfig.getParameter<edm::InputTag>("TrackLabel");
labelRecVtx_ = iConfig.getParameter<edm::InputTag>("VertexLabel");
labelBS_ = iConfig.getParameter<edm::InputTag>("BeamSpotLabel");
labelEB_ = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
labelEE_ = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
labelHBHE_ = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
labelHltGT_ = iConfig.getParameter<edm::InputTag>("L1GTSeedLabel");
labelTriggerEvent_ = iConfig.getParameter<edm::InputTag>("TriggerEventLabel");
labelTriggerResults_ = iConfig.getParameter<edm::InputTag>("TriggerResultLabel");
labelIsoTk_ = iConfig.getParameter<std::string>("IsoTrackLabel");

// define tokens for access
tok_hltGT_ = consumes<trigger::TriggerFilterObjectWithRefs>(labelHltGT_);
tok_trigEvt_ = consumes<trigger::TriggerEvent>(labelTriggerEvent_);
tok_trigRes_ = consumes<edm::TriggerResults>(labelTriggerResults_);
tok_genTrack_ = consumes<reco::TrackCollection>(labelGenTrack_);
tok_recVtx_ = consumes<reco::VertexCollection>(labelRecVtx_);
tok_bs_ = consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot"));
tok_bs_ = consumes<reco::BeamSpot>(labelBS_);
tok_EB_ = consumes<EcalRecHitCollection>(labelEB_);
tok_EE_ = consumes<EcalRecHitCollection>(labelEE_);
tok_hbhe_ = consumes<HBHERecHitCollection>(labelHBHE_);
Expand Down Expand Up @@ -195,10 +198,10 @@ AlCaIsoTracksProducer::AlCaIsoTracksProducer(const edm::ParameterSet& iConfig) :
trigKount = trigPass = dummy;

//create also IsolatedPixelTrackCandidateCollection which contains isolation info and reference to primary track
produces<reco::HcalIsolatedTrackCandidateCollection>("HcalIsolatedTrackCollection");
produces<reco::HcalIsolatedTrackCandidateCollection>(labelIsoTk_);
produces<reco::VertexCollection>(labelRecVtx_.label());
produces<EcalRecHitCollection>("EcalRecHitsEB");
produces<EcalRecHitCollection>("EcalRecHitsEE");
produces<EcalRecHitCollection>(labelEB_.instance());
produces<EcalRecHitCollection>(labelEE_.instance());
produces<HBHERecHitCollection>(labelHBHE_.label());

edm::LogInfo("HcalIsoTrack") << " Expected to produce the collections:\n"
Expand Down Expand Up @@ -335,11 +338,11 @@ void AlCaIsoTracksProducer::produce(edm::Event& iEvent, const edm::EventSetup& i
outputHBHEColl->push_back(*hhit);
}

iEvent.put(outputHcalIsoTrackColl, "HcalIsolatedTrackCollection");
iEvent.put(outputVColl, labelRecVtx_.label());
iEvent.put(outputEBColl, "EcalRecHitsEB");
iEvent.put(outputEEColl, "EcalRecHitsEE");
iEvent.put(outputHBHEColl, labelHBHE_.label());
iEvent.put(outputHcalIsoTrackColl, labelIsoTk_);
iEvent.put(outputVColl, labelRecVtx_.label());
iEvent.put(outputEBColl, labelEB_.instance());
iEvent.put(outputEEColl, labelEE_.instance());
iEvent.put(outputHBHEColl, labelHBHE_.label());
}
}
}
Expand Down
Expand Up @@ -11,7 +11,7 @@
ELowHF = cms.double(10),
EHighHF = cms.double(150),
HistOutFile = cms.untracked.string('analysis_minbias.root'),
CorrFile = cms.untracked.string('dummy'),
CorrFile = cms.untracked.string('CorFactor.txt'),
IgnoreL1 = cms.untracked.bool(False),
HcalIeta = cms.untracked.vint32([]),
HcalIphi = cms.untracked.vint32([]),
Expand Down
1 change: 0 additions & 1 deletion Calibration/HcalCalibAlgos/src/RecAnalyzerMinbias.cc
Expand Up @@ -113,7 +113,6 @@ RecAnalyzerMinbias::RecAnalyzerMinbias(const edm::ParameterSet& iConfig) {
corrFactor_[detId] = cfac;
ndets++;
}
nrec++;
}
infile.close();
edm::LogInfo("AnalyzerMB") << "Reads " << nrec << " correction factors for "
Expand Down
67 changes: 12 additions & 55 deletions Calibration/HcalCalibAlgos/test/analysis_rec_minbias_cfg.py
Expand Up @@ -4,17 +4,11 @@

# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
process.load('Geometry.HcalEventSetup.HcalTopology_cfi')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
process.load('Configuration.StandardSequences.MagneticField_cff')
process.load('Configuration.StandardSequences.RawToDigi_Data_cff')
process.load('Configuration.StandardSequences.EndOfProcess_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.load('RecoLocalCalo.Configuration.RecoLocalCalo_cff')
process.load('RecoLocalCalo.Configuration.hcalLocalRecoNZS_cff')
process.load('Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalMinBias_cff')


process.configurationMetadata = cms.untracked.PSet(
version = cms.untracked.string('$Revision: 1.163 $'),
Expand All @@ -30,63 +24,26 @@
# Input source
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/203/522/F233228C-D206-E211-BC2E-0025901D629C.root',
'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/197/556/D673F957-93C0-E111-8332-003048D2BF1C.root',
'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/198/941/3AA08F69-9ECD-E111-A338-5404A63886C5.root',
'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/197/601/BAC19C2C-3EC1-E111-8A78-001D09F241B9.root',
'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/197/610/F68235DD-01C1-E111-9583-0019B9F72CE5.root',
'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/197/719/2AADB426-7BC1-E111-9053-001D09F24353.root',
'root://cmsxrootd.fnal.gov//store/data/Run2012A/HcalNZS/RAW/v1/000/190/456/88BBA906-3B7F-E111-BD13-001D09F2441B.root',
'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/199/975/24F29491-FADA-E111-A19B-BCAEC5329716.root',
'file:/tmp/sunanda/0000E8D3-F58A-E411-8537-001E67396DEC.root',
# 'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/203/522/F233228C-D206-E211-BC2E-0025901D629C.root',
# 'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/197/556/D673F957-93C0-E111-8332-003048D2BF1C.root',
# 'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/198/941/3AA08F69-9ECD-E111-A338-5404A63886C5.root',
# 'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/197/601/BAC19C2C-3EC1-E111-8A78-001D09F241B9.root',
# 'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/197/610/F68235DD-01C1-E111-9583-0019B9F72CE5.root',
# 'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/197/719/2AADB426-7BC1-E111-9053-001D09F24353.root',
# 'root://cmsxrootd.fnal.gov//store/data/Run2012A/HcalNZS/RAW/v1/000/190/456/88BBA906-3B7F-E111-BD13-001D09F2441B.root',
# 'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/199/975/24F29491-FADA-E111-A19B-BCAEC5329716.root',
)
)

############################################################################
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
from Configuration.AlCa.autoCond import autoCond
process.GlobalTag.globaltag = autoCond['startup'] #data

process.es_pool = cms.ESSource("PoolDBESSource",
process.CondDBSetup,
timetype = cms.string('runnumber'),
toGet = cms.VPSet(
cms.PSet(
record = cms.string("HcalRespCorrsRcd"),
tag = cms.string("HcalRespCorrs_v4.5_offline")),

cms.PSet(
record = cms.string('HcalGainsRcd'),
tag = cms.string('HcalGains_v5.07_offline')),

),
connect = cms.string('frontier://FrontierProd/CMS_COND_31X_HCAL'),
authenticationMethod = cms.untracked.uint32(0),
)
process.es_prefer_es_pool = cms.ESPrefer( "PoolDBESSource", "es_pool")
process.GlobalTag.globaltag = autoCond['run2_mc']

############################################################################
#### Analysis

process.minbiasana = cms.EDAnalyzer("Analyzer_minbias",
HistOutFile = cms.untracked.string('recanalyzer.root'),
hbheInputMB = cms.InputTag("hbherecoMB"),
hoInputMB = cms.InputTag("horecoMB"),
hfInputMB = cms.InputTag("hfrecoMBspecial"),
hbheInputNoise = cms.InputTag("hbherecoNoise"),
hoInputNoise = cms.InputTag("horecoNoise"),
hfInputNoise = cms.InputTag("hfrecoNoise"),
triglabel=cms.untracked.InputTag('TriggerResults','','HLT'),
Recalib = cms.bool(False)
)

process.schedule = cms.Path(
process.hcalDigis*
process.gtDigis*
process.hcalLocalRecoSequenceNZS*
process.seqALCARECOHcalCalMinBiasNoHLT*
process.minbiasana*
process.endOfProcess
)


process.load("Calibration.HcalCalibAlgos.recAnalyzerMinbias_cfi")

process.schedule = cms.Path(process.RecAnalyzerMinbias*process.endOfProcess)
9 changes: 3 additions & 6 deletions Calibration/HcalCalibAlgos/test/analysis_sim_minbias_cfg.py
Expand Up @@ -27,7 +27,7 @@
# Input source
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'root://cmsxrootd.fnal.gov//store/data/Run2012C/HcalNZS/RAW/v1/000/197/559/FA519929-93C0-E111-9C4A-BCAEC532971C.root',
'file:/tmp/sunanda/0000E8D3-F58A-E411-8537-001E67396DEC.root',
)
)

Expand All @@ -39,13 +39,10 @@
############################################################################
#### Analysis

process.minbiasana = cms.EDAnalyzer("SimAnalyzerMinbias",
HistOutFile = cms.untracked.string('simanalyzer.root'),
TimeCut = cms.untracked.double(100.0)
)
process.load('Calibration.HcalCalibAlgos.simAnalyzerMinbias_cfi')

process.schedule = cms.Path(
process.minbiasana*
process.simAnalyzerMinbias*
process.endOfProcess
)

Expand Down

0 comments on commit de9a9ff

Please sign in to comment.