Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@
modulesToRemove.append(horeco)
modulesToRemove.append(hcalnoise)
modulesToRemove.append(zdcreco)
modulesToRemove.append(zdcrecoRun3)
modulesToRemove.append(castorreco)
##it's OK according to Ronny modulesToRemove.append(CSCHaloData)#needs digis
reconstruction_fromRECO = reconstruction.copyAndExclude(modulesToRemove+noTrackingAndDependent)
Expand Down
17 changes: 17 additions & 0 deletions DataFormats/HcalRecHit/interface/ZDCRecHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,25 @@ class ZDCRecHit : public CaloRecHit {
// follow EcalRecHit method of adding variable flagBits_ to CaloRecHit
float lowGainEnergy() const { return lowGainEnergy_; };

constexpr inline void setEnergySOIp1(const float en) { energySOIp1_ = en; };
constexpr inline float energySOIp1() const { return energySOIp1_; }; // energy of Slice of Interest plus 1
constexpr inline void setRatioSOIp1(const float ratio) { ratioSOIp1_ = ratio; };
constexpr inline float ratioSOIp1() const {
return ratioSOIp1_;
}; // ratio of Energy of (Slice of Interest)/ (Slice of Interest plus 1)
constexpr inline void setTDCtime(const float time) { TDCtime_ = time; };
constexpr inline float TDCtime() const { return TDCtime_; };
constexpr inline void setChargeWeightedTime(const float time) {
chargeWeightedTime_ = time;
}; // time of activity determined by charged weighted average
constexpr inline float chargeWeightedTime() const { return chargeWeightedTime_; };

private:
float lowGainEnergy_;
float energySOIp1_;
float ratioSOIp1_;
float TDCtime_;
float chargeWeightedTime_;
};

std::ostream& operator<<(std::ostream& s, const ZDCRecHit& hit);
Expand Down
10 changes: 8 additions & 2 deletions DataFormats/HcalRecHit/src/ZDCRecHit.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#include "DataFormats/HcalRecHit/interface/ZDCRecHit.h"

ZDCRecHit::ZDCRecHit() : CaloRecHit(), lowGainEnergy_() {}
ZDCRecHit::ZDCRecHit()
: CaloRecHit(), lowGainEnergy_(), energySOIp1_(-99), ratioSOIp1_(-99), TDCtime_(-99), chargeWeightedTime_(-99) {}

ZDCRecHit::ZDCRecHit(const HcalZDCDetId& id, float energy, float time, float lowGainEnergy)
: CaloRecHit(id, energy, time), lowGainEnergy_(lowGainEnergy) {}
: CaloRecHit(id, energy, time),
lowGainEnergy_(lowGainEnergy),
energySOIp1_(-99),
ratioSOIp1_(-99),
TDCtime_(-99),
chargeWeightedTime_(-99) {}

std::ostream& operator<<(std::ostream& s, const ZDCRecHit& hit) {
return s << hit.id() << ": " << hit.energy() << " GeV, " << hit.time() << " ns";
Expand Down
3 changes: 2 additions & 1 deletion DataFormats/HcalRecHit/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<version ClassVersion="12" checksum="1242817974"/>
<version ClassVersion="10" checksum="1310006561"/>
</class>
<class name="ZDCRecHit" ClassVersion="12">
<class name="ZDCRecHit" ClassVersion="13">
<version ClassVersion="13" checksum="1625066895"/>
<version ClassVersion="12" checksum="4082648564"/>
<version ClassVersion="11" checksum="2452340764"/>
</class>
Expand Down
6 changes: 5 additions & 1 deletion RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@
srcTracks = "generalTracks",
srcVertex = "offlinePrimaryVertices"
)

from Configuration.Eras.Modifier_run3_common_cff import run3_common
run3_common.toModify(hiCentrality, srcZDChits = "zdcrecoRun3",lowGainZDC = False)

from Configuration.ProcessModifiers.phase2_pp_on_AA_cff import phase2_pp_on_AA
phase2_pp_on_AA.toModify(hiCentrality,
isPhase2 = True,
producePixelTracks = False,
srcTracks = "generalTracks",
srcVertex = "offlinePrimaryVertices"
)
)
2 changes: 2 additions & 0 deletions RecoHI/HiCentralityAlgos/python/pACentrality_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@

)

from Configuration.Eras.Modifier_run3_common_cff import run3_common
run3_common.toModify(pACentrality, srcZDChits = "zdcrecoRun3",lowGainZDC =False)

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
outputCommands = cms.untracked.vstring(
'keep recoEvtPlanes_hiEvtPlane_*_*',
'keep ZDCRecHitsSorted_zdcreco_*_*',
'keep ZDCRecHitsSorted_zdcrecoRun3_*_*',
'keep ZDCDataFramesSorted_hcalDigis_*_*',
'keep HFRecHitsSorted_hfreco_*_*')
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,11 @@
from RecoLocalCalo.Configuration.hcalLocalRecoNZS_cff import *
calolocalrecoTaskCosmicsNZS = cms.Task(ecalLocalRecoTaskCosmics,hcalLocalRecoTask,hcalLocalRecoTaskNZS)
calolocalrecoCosmicsNZS = cms.Sequence(calolocalrecoTaskCosmicsNZS)

#--- for Run 3 and later
_run3_hcalLocalRecoTask = _phase1_hcalLocalRecoTask.copy()
from RecoLocalCalo.HcalRecProducers.zdcrecoRun3_cfi import zdcrecoRun3
_run3_hcalLocalRecoTask.remove(zdcreco)
_run3_hcalLocalRecoTask.add(zdcrecoRun3)
from Configuration.Eras.Modifier_run3_common_cff import run3_common
run3_common.toReplaceWith(hcalLocalRecoTask, _run3_hcalLocalRecoTask)
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
'keep ZDCDataFramesSorted_castorDigis_*_*',
'keep ZDCDataFramesSorted_simHcalUnsuppressedDigis_*_*',
'keep ZDCRecHitsSorted_zdcreco_*_*',
'keep ZDCRecHitsSorted_zdcrecoRun3_*_*',
'keep HcalUnpackerReport_castorDigis_*_*',
'keep HcalUnpackerReport_hcalDigis_*_*')
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
'keep ZDCDataFramesSorted_hcalDigis_*_*',
'keep ZDCDataFramesSorted_castorDigis_*_*',
'keep QIE10DataFrameHcalDataFrameContainer_hcalDigis_ZDC_*',
'keep ZDCRecHitsSorted_zdcreco_*_*')
'keep ZDCRecHitsSorted_zdcreco_*_*',
'keep ZDCRecHitsSorted_zdcrecoRun3_*_*')
)
RecoLocalCaloRECO.outputCommands.extend(RecoLocalCaloAOD.outputCommands)
RecoLocalCaloRECO.outputCommands.extend(ecalLocalRecoRECO.outputCommands)
Expand Down
13 changes: 9 additions & 4 deletions RecoLocalCalo/Configuration/python/hcalLocalReco_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@
#--- for Run 3 and later
_run3_hcalLocalRecoTask = _phase1_hcalLocalRecoTask.copy()
_run3_hcalLocalRecoTask.remove(hbheprereco)
from Configuration.Eras.Modifier_run3_HB_cff import run3_HB
run3_HB.toReplaceWith(hcalLocalRecoTask, _run3_hcalLocalRecoTask)

from RecoLocalCalo.HcalRecProducers.zdcrecoRun3_cfi import zdcrecoRun3
_run3_hcalLocalRecoTask.remove(zdcreco)
_run3_hcalLocalRecoTask.add(zdcrecoRun3)
from Configuration.Eras.Modifier_run3_common_cff import run3_common
run3_common.toReplaceWith(hcalLocalRecoTask, _run3_hcalLocalRecoTask)

#--- for Run 3 on GPU
from Configuration.ProcessModifiers.gpu_cff import gpu
Expand All @@ -79,9 +83,10 @@
alpaka.toReplaceWith(hcalLocalRecoTask, _run3_hcalLocalRecoPortableTask)

#--- HCAL-only workflow
hcalOnlyLocalRecoTask = hcalLocalRecoTask.copyAndExclude([zdcreco])
hcalOnlyLocalRecoTask = hcalLocalRecoTask.copyAndExclude([zdcreco,zdcrecoRun3])

#--- HCAL-only workflow for Run 2 on GPU
from Configuration.Eras.Modifier_run3_HB_cff import run3_HB
from RecoLocalCalo.HcalRecProducers.hcalCPURecHitsProducer_cfi import hcalCPURecHitsProducer as _hbheprerecoFromCUDA
(gpu & ~run3_HB).toModify(hbheprereco,
cuda = _hbheprerecoFromCUDA.clone(
Expand All @@ -95,6 +100,6 @@
)

#--- for FastSim
_fastSim_hcalLocalRecoTask = hcalLocalRecoTask.copyAndExclude([zdcreco])
_fastSim_hcalLocalRecoTask = hcalLocalRecoTask.copyAndExclude([zdcreco,zdcrecoRun3])
from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toReplaceWith( hcalLocalRecoTask, _fastSim_hcalLocalRecoTask )
74 changes: 74 additions & 0 deletions RecoLocalCalo/HcalRecAlgos/interface/ZdcSimpleRecAlgo_Run3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#ifndef ZDCSIMPLERECALGO_RUN3_H
#define ZDCSIMPLERECALGO_RUN3_H 1

#include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
#include "DataFormats/HcalDigi/interface/HFDataFrame.h"
#include "DataFormats/HcalDigi/interface/HODataFrame.h"
#include "DataFormats/HcalDigi/interface/ZDCDataFrame.h"
#include "DataFormats/HcalDigi/interface/HcalCalibDataFrame.h"
#include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
#include "DataFormats/HcalRecHit/interface/HFRecHit.h"
#include "DataFormats/HcalRecHit/interface/HORecHit.h"
#include "DataFormats/HcalRecHit/interface/ZDCRecHit.h"
#include "DataFormats/HcalRecHit/interface/HcalCalibRecHit.h"
#include "CalibFormats/HcalObjects/interface/HcalCoder.h"
#include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
#include "CalibFormats/HcalObjects/interface/HcalCalibrationWidths.h"
#include "CondFormats/HcalObjects/interface/HcalPedestal.h"
#include "CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentCorrection.h"
#include <memory>

#include "DataFormats/HcalDigi/interface/QIE10DataFrame.h"

/** \class ZdcSimpleRecAlgo_Run3

This class reconstructs RecHits from Digis for ZDC by addition
of selected time samples, pedestal subtraction, and gain application. The
time of the hit is reconstructed using a weighted peak bin calculation
supplemented by precise time lookup table. A consumer of this class also
has the option of correcting the reconstructed time for energy-dependent
time slew associated with the QIE.

A sencon method based on a based on a event by event substraction is also
implelented. signal = (S4 + S5 - 2*(S1+S2+S3 + S7+S8+S9+S10))*(ft-Gev constant)
where SN is the signal in the nth time slice

\author E. Garcia CSU & J. Gomez UMD
*/

class ZdcSimpleRecAlgo_Run3 {
public:
/** Simple constructor for PMT-based detectors */
ZdcSimpleRecAlgo_Run3(int recoMethod);
void initCorrectionMethod(const int method, const int ZdcSection);
void initTemplateFit(const std::vector<unsigned int>& bxTs,
const std::vector<double>& chargeRatios,
const int nTs,
const int ZdcSection);
void initRatioSubtraction(const float ratio, const float frac, const int ZdcSection);

ZDCRecHit reco0(const QIE10DataFrame& digi,
const HcalCoder& coder,
const HcalCalibrations& calibs,
const HcalPedestal& effPeds,
const std::vector<unsigned int>& myNoiseTS,
const std::vector<unsigned int>& mySignalTS) const;
// reco method currently used to match L1 Trigger LUT energy formula
ZDCRecHit reconstruct(const QIE10DataFrame& digi,
const std::vector<unsigned int>& myNoiseTS,
const std::vector<unsigned int>& mySignalTS,
const HcalCoder& coder,
const HcalCalibrations& calibs,
const HcalPedestal& effPeds) const;

private:
int recoMethod_;
int nTs_;
std::map<int, std::vector<double>> templateFitValues_; // Values[ZdcSection][Ts]
std::map<int, bool> templateFitValid_; // Values[ZdcSection]
std::map<int, float> ootpuRatio_; // Values[ZdcSection]
std::map<int, float> ootpuFrac_; // Values[ZdcSection]
std::map<int, int> correctionMethod_; // Values[ZdcSection]
};

#endif
Loading