ATLAS Offline Software
Loading...
Searching...
No Matches
ZdcNtuple.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
8
10#include "xAODRootAccess/Init.h"
13
15
16#include <TTree.h>
17#include <TH1.h>
18#include <TSystem.h>
19#include <TFile.h>
20
21
22// this is needed to distribute the algorithm to the workers
23//ClassImp(ZdcNtuple)
24
25ZdcNtuple :: ZdcNtuple (const std::string& name, ISvcLocator *pSvcLocator)
26 : EL::AnaAlgorithm(name, pSvcLocator),
27 m_grl ("GoodRunsListSelectionTool/grl", this),
28 //m_zdcAnalysisTool("ZDC::ZdcAnalysisTool/ZdcAnalysisTool", this),
29 m_selTool( "InDet::InDetTrackSelectionTool/TrackSelectionTool", this )
30{
31 // Here you put any code for the base initialization of variables,
32 // e.g. initialize all pointers to 0. Note that you should only put
33 // the most basic initialization here, since this method will be
34 // called on both the submission and the worker node. Most of your
35 // initialization code will go into histInitialize() and
36 // initialize().
37 m_setupTrigHist = false;
39
40 declareProperty("isMC", m_isMC = false, "MC mode");
41 declareProperty("enableOutputTree", enableOutputTree = false, "Enable output tree");
42 declareProperty("enableOutputSamples", enableOutputSamples = false, "Output ZDC and RPD raw data");
43 declareProperty("enableTrigger", enableTrigger = true, "comment");
44 declareProperty("enableTracks", enableTracks = false, "comment");
45 declareProperty("trackLimit", trackLimit = 500, "comment");
46 declareProperty("enableID", enableID = false, "turn on to enable ID tracks & vertices for physics streams");
47 declareProperty("enableCalo", enableCalo = false, "turn on to enable calorimeter energy info for physics streams");
48 declareProperty("enableClusters", enableClusters = false, "turn on to enable calo topo cluster info for physics streams");
49 declareProperty("writeOnlyTriggers", writeOnlyTriggers = false, "comment");
50 declareProperty("useGRL", useGRL = true, "comment");
51 declareProperty("grlFilename", grlFilename = "$ROOTCOREBIN/data/ZdcNtuple/data16_hip8TeV.periodAllYear_DetStatus-v86-pro20-19_DQDefects-00-02-04_PHYS_HeavyIonP_All_Good.xml", "comment");
52 declareProperty("slimmed", slimmed = false, "comment");
53 declareProperty("zdcCalib", zdcCalib = false, "zdc/ZDCCalib file");
54 declareProperty("zdcInj", zdcInj = false, "ZDC injected pulse");
55 declareProperty("zdcLaser", zdcLaser = false, "Run 2 ZDC Laser");
56 declareProperty("zdcOnly", zdcOnly = false, "comment");
57 declareProperty("zdcLowGainMode", zdcLowGainMode = 0, "comment");
58 declareProperty("gapPtMin", m_gapPtMin = 200, "minimum pT of cluster used in gaps");
59 declareProperty("flipDelay", flipDelay = 0, "comment");
60 declareProperty("reprocZdc", reprocZdc = 0, "comment");
61 declareProperty("auxSuffix", auxSuffix = "", "comment");
62 declareProperty("nsamplesZdc", nsamplesZdc = 24, "number of samples, 7 = most of Run 2, 24,32,40 = Run 3");
63 declareProperty("lhcf2022", lhcf2022 = false,"LHCf2022 general config");
64 declareProperty("lhcf2022afp", lhcf2022afp = false,"LHCf2022 AFP-specific config");
65 declareProperty("lhcf2022zdc", lhcf2022zdc = false,"LHCf2022 ZDC-specific config");
66 declareProperty("pbpb2023", pbpb2023 = false, "PbPb2023 config");
67 declareProperty("oo2025", oo2025 = false, "OO and NeNe 2025 config");
68 declareProperty("zdcConfig", zdcConfig = "PbPb2018", "argument to configure ZdcAnalysisTool");
69 declareProperty("doZdcCalib", doZdcCalib = false, "perform ZDC energy calibration");
70 declareProperty("enableZDC", enableZDC = true);
71 declareProperty("enableRPD",enableRPD = false,"enable reading any RPD decorations");
72 declareProperty("enableRPDAmp",enableRPDAmp = false,"enable reading RPD amplitudes (also requires enableRPD)");
73 declareProperty("enableCentroid",enableCentroid = false,"enable reading centroid decorations (also requires enableRPD)");
74
75 declareProperty( "TrackSelectionTool", m_selTool );
76
77 m_zdcAnalysisTool.declarePropertyFor (this, "zdcAnalysisTool");
78
79}
80
81/*
82StatusCode ZdcNtuple :: setupJob (EL::Job& job)
83{
84 // Here you put code that sets up the job on the submission object
85 // so that it is ready to work with your algorithm, e.g. you can
86 // request the D3PDReader service or add output files. Any code you
87 // put here could instead also go into the submission script. The
88 // sole advantage of putting it here is that it gets automatically
89 // activated/deactivated when you add/remove the algorithm from your
90 // job, which may or may not be of value to you.
91
92 job.useXAOD ();
93 ANA_CHECK( "setupJob()", xAOD::Init() ); // call before opening first file
94
95 return StatusCode::SUCCESS;
96}
97*/
98
99
100StatusCode ZdcNtuple :: initialize ()
101{
102 // Here you do everything that needs to be done at the very
103 // beginning on each worker node, e.g. create histograms and output
104 // trees. This method gets called before any input files are
105 // connected.
106
107 ANA_MSG_DEBUG("Howdy from Initialize!");
108
110 ANA_CHECK(m_zdcSumContainerName.initialize());
112
114 {
115 h_TCSigCut = new TH1D("_gapSigCut_", "", 98, -4.9, 4.9);
116 h_TCSigCut->SetContent(&m_gapThresholds[0]);
117
118 ANA_CHECK( book(TTree("zdcTree", "ZDC Tree")));
119 m_outputTree = tree( "zdcTree" );
120
121 m_outputTree->Branch("runNumber", &t_runNumber, "runNumber/i");
122 m_outputTree->Branch("eventNumber", &t_eventNumber, "eventNumber/i");
123 m_outputTree->Branch("lumiBlock", &t_lumiBlock, "lumiBlock/i");
124 m_outputTree->Branch("bunchGroup", &t_bunchGroup, "bunchGroup/b");
125 m_outputTree->Branch("bcid", &t_bcid, "bcid/i");
126 if (zdcInj) m_outputTree->Branch("vInj",&t_vInj,"vInj/F");
127 m_outputTree->Branch("avgIntPerCrossing", &t_avgIntPerCrossing, "avgIntPerCrossing/F");
128 m_outputTree->Branch("actIntPerCrossing", &t_actIntPerCrossing, "actIntPerCrossing/F");
129 m_outputTree->Branch("trigger", &t_trigger, "trigger/l");
130 m_outputTree->Branch("trigger_TBP", &t_trigger_TBP, "trigger_TBP/i");
131 m_outputTree->Branch("tbp", &t_tbp, "tbp[16]/i");
132 m_outputTree->Branch("tav", &t_tav, "tav[16]/i");
133 m_outputTree->Branch("passBits", &t_passBits, "passBits/i");
134 m_outputTree->Branch("extendedLevel1ID",&t_extendedLevel1ID,"extendedLevel1ID/i");
135 m_outputTree->Branch("timeStamp",&t_timeStamp,"timeStamp/i");
136 m_outputTree->Branch("timeStampNSOffset",&t_timeStampNSOffset,"timeStampNSOffset/i");
137 m_outputTree->Branch("zdcEventInfoError",&t_zdcEventInfoError,"zdcEventInfoError/b");
138 m_outputTree->Branch("zdcEventInfoErrorWord",&t_zdcEventInfoErrorWord,"zdcEventInfoErrorWord/i");
139 // ZDC and RPD decoding errors
140 m_outputTree->Branch("zdcDecodingError",&t_zdcDecodingError,"zdcDecodingError/b");
141 m_outputTree->Branch("rpdDecodingError",&t_rpdDecodingError,"rpdDecodingError/b");
142
143 if (enableZDC)
144 {
146 {
147 if (nsamplesZdc == 7)
148 {
149 ANA_MSG_INFO("Setting up for 7 samples");
150 m_outputTree->Branch("zdc_raw", &t_raw7, "zdc_raw[2][4][2][2][7]/s"); // 7 samples
151 }
152
153 if (nsamplesZdc == 15)
154 {
155 ANA_MSG_INFO("Setting up for 15 samples");
156 m_outputTree->Branch("zdc_raw", &t_raw15, "zdc_raw[2][4][2][2][15]/s"); // 15 samples
157 }
158
159 if (nsamplesZdc == 24)
160 {
161 ANA_MSG_INFO("Setting up for 24 samples");
162 m_outputTree->Branch("zdc_raw", &t_raw24, "zdc_raw[2][4][2][2][24]/s"); // 24 samples
163 m_outputTree->Branch("rpd_raw", &t_rpdRaw, "rpd_raw[2][16][24]/s"); // 24 samples
164 }
165 if (nsamplesZdc == 32)
166 {
167 ANA_MSG_INFO("Setting up for 32 samples");
168 m_outputTree->Branch("zdc_raw", &t_raw32, "zdc_raw[2][4][2][2][32]/s"); // 32 samples
169 m_outputTree->Branch("rpd_raw", &t_rpdRaw32, "rpd_raw[2][16][32]/s"); // 32 samples
170 }
171 if (nsamplesZdc == 40)
172 {
173 ANA_MSG_INFO("Setting up for 40 samples");
174 m_outputTree->Branch("zdc_raw", &t_raw40, "zdc_raw[2][4][2][2][40]/s"); // 40 samples
175 m_outputTree->Branch("rpd_raw", &t_rpdRaw40, "rpd_raw[2][16][40]/s"); // 40 samples
176 }
177 }
178
179 m_outputTree->Branch("zdc_ZdcAmp", &t_ZdcAmp, "zdc_ZdcAmp[2]/F");
180 m_outputTree->Branch("zdc_ZdcAmpErr", &t_ZdcAmpErr, "zdc_ZdcAmpErr[2]/F");
181 m_outputTree->Branch("zdc_ZdcEnergy", &t_ZdcEnergy, "zdc_ZdcEnergy[2]/F");
182 m_outputTree->Branch("zdc_ZdcEnergyErr", &t_ZdcEnergyErr, "zdc_ZdcEnergyErr[2]/F");
183 m_outputTree->Branch("zdc_ZdcNLEnergy", &t_ZdcNLEnergy, "zdc_ZdcNLEnergy[2]/F");
184 m_outputTree->Branch("zdc_ZdcNLEnergyErr", &t_ZdcNLEnergyErr, "zdc_ZdcNLEnergyErr[2]/F");
185 m_outputTree->Branch("zdc_ZdcTime", &t_ZdcTime, "zdc_ZdcTime[2]/F");
186 m_outputTree->Branch("zdc_ZdcStatus", &t_ZdcStatus, "zdc_ZdcStatus[2]/S");
187 m_outputTree->Branch("zdc_ZdcTrigEff", &t_ZdcTrigEff, "zdc_ZdcTrigEff[2]/F");
188 m_outputTree->Branch("zdc_ZdcModuleMask", &t_ZdcModuleMask, "zdc_ZdcModuleMask/i");
189 m_outputTree->Branch("zdc_ZdcLucrodTriggerSideAmp",&t_ZdcLucrodTriggerSideAmp,"zdc_ZdcLucrodTriggerSideAmp[2]/S");
190 m_outputTree->Branch("zdc_ZdcLucrodTriggerSideAmpLG",&t_ZdcLucrodTriggerSideAmpLG,"zdc_ZdcLucrodTriggerSideAmpLG[2]/S");
191
192 m_outputTree->Branch("zdc_ZdcModuleAmp", &t_ZdcModuleAmp, "zdc_ZdcModuleAmp[2][4]/F");
193 m_outputTree->Branch("zdc_ZdcModuleAmpUncorr", &t_ZdcModuleAmpUncorr, "zdc_ZdcModuleAmpUncorr[2][4]/F");
194 m_outputTree->Branch("zdc_ZdcModuleTime", &t_ZdcModuleTime, "zdc_ZdcModuleTime[2][4]/F");
195 m_outputTree->Branch("zdc_ZdcModuleFitAmp", &t_ZdcModuleFitAmp, "zdc_ZdcModuleFitAmp[2][4]/F");
196 m_outputTree->Branch("zdc_ZdcModuleFitT0", &t_ZdcModuleFitT0, "zdc_ZdcModuleFitT0[2][4]/F");
197 m_outputTree->Branch("zdc_ZdcModuleStatus", &t_ZdcModuleStatus, "zdc_ZdcModuleStatus[2][4]/i");
198 m_outputTree->Branch("zdc_ZdcModuleChisq", &t_ZdcModuleChisq, "zdc_ZdcModuleChisq[2][4]/F");
199 m_outputTree->Branch("zdc_ZdcModuleChisqRatio", &t_ZdcModuleChisqRatio, "zdc_ZdcModuleChisqRatio[2][4]/F");
200 m_outputTree->Branch("zdc_ZdcModuleCalibAmp", &t_ZdcModuleCalibAmp, "zdc_ZdcModuleCalibAmp[2][4]/F");
201 m_outputTree->Branch("zdc_ZdcModuleCalibTime", &t_ZdcModuleCalibTime, "zdc_ZdcModuleCalibTime[2][4]/F");
202 m_outputTree->Branch("zdc_ZdcModuleBkgdMaxFraction", &t_ZdcModuleBkgdMaxFraction, "zdc_ZdcModuleBkgdMaxFraction[2][4]/F");
203 m_outputTree->Branch("zdc_ZdcModuleAmpError", &t_ZdcModuleAmpError, "zdc_ZdcModuleAmpError[2][4]/F");
204 m_outputTree->Branch("zdc_ZdcModuleMinDeriv2nd", &t_ZdcModuleMinDeriv2nd, "zdc_ZdcModuleMinDeriv2nd[2][4]/F");
205 m_outputTree->Branch("zdc_ZdcModulePresample", &t_ZdcModulePresample, "zdc_ZdcModulePresample[2][4]/F");
206 m_outputTree->Branch("zdc_ZdcModulePreSampleAmp", &t_ZdcModulePreSampleAmp, "zdc_ZdcModulePreSampleAmp[2][4]/F");
207 m_outputTree->Branch("zdc_ZdcLucrodTriggerAmp",&t_ZdcLucrodTriggerAmp,"zdc_ZdcLucrodTriggerAmp[2][4]/S");
208 m_outputTree->Branch("zdc_ZdcLucrodTriggerAmpLG",&t_ZdcLucrodTriggerAmpLG,"zdc_ZdcLucrodTriggerAmpLG[2][4]/S");
209 m_outputTree->Branch("zdc_ZdcModuleMaxADC",&t_ZdcModuleMaxADC,"zdc_ZdcModuleMaxADC[2][4]/F");
210 m_outputTree->Branch("zdc_ZdcModuleMaxADCHG",&t_ZdcModuleMaxADCHG,"zdc_ZdcModuleMaxADCHG[2][4]/F");
211 m_outputTree->Branch("zdc_ZdcModuleMaxADCLG",&t_ZdcModuleMaxADCLG,"zdc_ZdcModuleMaxADCLG[2][4]/F");
212 m_outputTree->Branch("zdc_ZdcModulePeakADCHG",&t_ZdcModulePeakADCHG,"zdc_ZdcModulePeakADCHG[2][4]/F");
213 m_outputTree->Branch("zdc_ZdcModulePeakADCLG",&t_ZdcModulePeakADCLG,"zdc_ZdcModulePeakADCLG[2][4]/F");
214 m_outputTree->Branch("zdc_ZdcModuleAmpLGRefit", &t_ZdcModuleAmpLGRefit, "zdc_ZdcModuleAmpLGRefit[2][4]/F");
215 m_outputTree->Branch("zdc_ZdcModuleAmpCorrLGRefit", &t_ZdcModuleAmpCorrLGRefit, "zdc_ZdcModuleAmpCorrLGRefit[2][4]/F");
216 m_outputTree->Branch("zdc_ZdcModuleT0LGRefit", &t_ZdcModuleT0LGRefit, "zdc_ZdcModuleT0LGRefit[2][4]/F");
217 m_outputTree->Branch("zdc_ZdcModuleT0SubLGRefit", &t_ZdcModuleT0SubLGRefit, "zdc_ZdcModuleT0SubLGRefit[2][4]/F");
218 m_outputTree->Branch("zdc_ZdcModuleChisqLGRefit", &t_ZdcModuleChisqLGRefit, "zdc_ZdcModuleChisqLGRefit[2][4]/F");
219
220 if(m_isMC){
221 //Modules
222 m_outputTree->Branch("zdc_ZdcModuleTruthTotal",&t_ZdcModuleTruthTotal,"zdc_ZdcModuleTruthTotal[2][7]/F");
223 m_outputTree->Branch("zdc_ZdcModuleTruthInvisible",&t_ZdcModuleTruthInvis,"zdc_ZdcModuleTruthInvisible[2][7]/F");
224 m_outputTree->Branch("zdc_ZdcModuleTruthEM",&t_ZdcModuleTruthEM,"zdc_ZdcModuleTruthEM[2][7]/F");
225 m_outputTree->Branch("zdc_ZdcModuleTruthNonEM",&t_ZdcModuleTruthNonEM,"zdc_ZdcModuleTruthNonEM[2][7]/F");
226 m_outputTree->Branch("zdc_ZdcModuleTruthEscaped",&t_ZdcModuleTruthEscaped,"zdc_ZdcModuleTruthEscaped[2][7]/F");
227 m_outputTree->Branch("zdc_ZdcModuleTruthNphotons",&t_ZdcModuleTruthNphotons,"zdc_ZdcModuleTruthNphotons[2][7]/i");
228 m_outputTree->Branch("zdc_RpdModuleTruthNphotons",&t_RpdModuleTruthNphotons,"zdc_RpdModuleTruthNphotons[2][16]/i");
229
230 //Sums
231 m_outputTree->Branch("zdc_ZdcTruthTotal",&t_ZdcTruthTotal,"zdc_ZdcTruthTotal[2]/F");
232 m_outputTree->Branch("zdc_ZdcTruthInvisible",&t_ZdcTruthInvis, "zdc_ZdcTruthInvisible[2]/F");
233 m_outputTree->Branch("zdc_ZdcTruthEM",&t_ZdcTruthEM,"zdc_ZdcTruthEM[2]/F");
234 m_outputTree->Branch("zdc_ZdcTruthNonEM",&t_ZdcTruthNonEM,"zdc_ZdcTruthNonEM[2]/F");
235 m_outputTree->Branch("zdc_ZdcTruthEscaped",&t_ZdcTruthEscaped,"zdc_ZdcTruthEscaped[2]/F");
236
237 //Event gen particles
238 m_outputTree->Branch("zdc_ZdcTruthParticlePosx",&t_ZdcTruthParticlePosx);
239 m_outputTree->Branch("zdc_ZdcTruthParticlePosy",&t_ZdcTruthParticlePosy);
240 m_outputTree->Branch("zdc_ZdcTruthParticlePosz",&t_ZdcTruthParticlePosz);
241 m_outputTree->Branch("zdc_ZdcTruthParticleTime",&t_ZdcTruthParticleTime);
242 m_outputTree->Branch("zdc_ZdcTruthParticlePx",&t_ZdcTruthParticlePx);
243 m_outputTree->Branch("zdc_ZdcTruthParticlePy",&t_ZdcTruthParticlePy);
244 m_outputTree->Branch("zdc_ZdcTruthParticlePz",&t_ZdcTruthParticlePz);
245 m_outputTree->Branch("zdc_ZdcTruthParticleEnergy",&t_ZdcTruthParticleEnergy);
246 m_outputTree->Branch("zdc_ZdcTruthParticlePid",&t_ZdcTruthParticlePid);
247 m_outputTree->Branch("zdc_ZdcTruthParticleStatus",&t_ZdcTruthParticleStatus);
248 }
249 }
250 if (enableRPD)
251 {
252 if (enableRPDAmp) {
253 m_outputTree->Branch("zdc_RpdChannelBaseline",&t_RpdChannelBaseline,"zdc_RpdChannelBaseline[2][16]/F");
254 m_outputTree->Branch("zdc_RpdChannelPileupExpFitParams",&t_RpdChannelPileupExpFitParams,"zdc_RpdChannelPileupExpFitParams[2][16][2]/F");
255 m_outputTree->Branch("zdc_RpdChannelPileupStretchedExpFitParams",&t_RpdChannelPileupStretchedExpFitParams,"zdc_RpdChannelPileupStretchedExpFitParams[2][16][3]/F");
256 m_outputTree->Branch("zdc_RpdChannelPileupExpFitParamErrs",&t_RpdChannelPileupExpFitParamErrs,"zdc_RpdChannelPileupExpFitParamErrs[2][16][2]/F");
257 m_outputTree->Branch("zdc_RpdChannelPileupStretchedExpFitParamErrs",&t_RpdChannelPileupStretchedExpFitParamErrs,"zdc_RpdChannelPileupStretchedExpFitParamErrs[2][16][3]/F");
258 m_outputTree->Branch("zdc_RpdChannelPileupExpFitMSE",&t_RpdChannelPileupExpFitMSE,"zdc_RpdChannelPileupExpFitMSE[2][16]/F");
259 m_outputTree->Branch("zdc_RpdChannelPileupStretchedExpFitMSE",&t_RpdChannelPileupStretchedExpFitMSE,"zdc_RpdChannelPileupStretchedExpFitMSE[2][16]/F");
260 m_outputTree->Branch("zdc_RpdChannelAmplitude",&t_RpdChannelAmplitude,"zdc_RpdChannelAmplitude[2][16]/F");
261 m_outputTree->Branch("zdc_RpdChannelAmplitudeCalib",&t_RpdChannelAmplitudeCalib,"zdc_RpdChannelAmplitudeCalib[2][16]/F");
262 m_outputTree->Branch("zdc_RpdChannelMaxADC",&t_RpdChannelMaxADC,"zdc_RpdChannelMaxADC[2][16]/F");
263 m_outputTree->Branch("zdc_RpdChannelMaxADCCalib",&t_RpdChannelMaxADCCalib,"zdc_RpdChannelMaxADCCalib[2][16]/F");
264 m_outputTree->Branch("zdc_RpdChannelMaxSample",&t_RpdChannelMaxSample,"zdc_RpdChannelMaxSample[2][16]/i");
265 m_outputTree->Branch("zdc_RpdChannelStatus",&t_RpdChannelStatus,"zdc_RpdChannelStatus[2][16]/i");
266 m_outputTree->Branch("zdc_RpdChannelPileupFrac",&t_RpdChannelPileupFrac,"zdc_RpdChannelPileupFrac[2][16]/F");
267 m_outputTree->Branch("zdc_RpdSideStatus",&t_RpdSideStatus,"zdc_RpdSideStatus[2]/i");
268 }
269 if (enableCentroid)
270 {
271 m_outputTree->Branch("zdc_centroidAvailable", &t_centroidDecorationsAvailable);
272 m_outputTree->Branch("zdc_centroidEventValid", &t_centroidEventValid, "zdc_centroidEventValid/B");
273 m_outputTree->Branch("zdc_centroidStatus", &t_centroidStatus, "zdc_centroidStatus[2]/i");
274 m_outputTree->Branch("zdc_RPDChannelSubtrAmp", &t_RPDChannelSubtrAmp, "zdc_RPDChannelSubtrAmp[2][16]/F");
275 m_outputTree->Branch("zdc_RPDSubtrAmpSum", &t_RPDSubtrAmpSum, "zdc_RPDSubtrAmpSum[2]/F");
276 m_outputTree->Branch("zdc_xCentroidPreGeomCorPreAvgSubtr", &t_xCentroidPreGeomCorPreAvgSubtr, "zdc_xCentroidPreGeomCorPreAvgSubtr[2]/F");
277 m_outputTree->Branch("zdc_yCentroidPreGeomCorPreAvgSubtr", &t_yCentroidPreGeomCorPreAvgSubtr, "zdc_yCentroidPreGeomCorPreAvgSubtr[2]/F");
278 m_outputTree->Branch("zdc_xCentroidPreAvgSubtr", &t_xCentroidPreAvgSubtr, "zdc_xCentroidPreAvgSubtr[2]/F");
279 m_outputTree->Branch("zdc_yCentroidPreAvgSubtr", &t_yCentroidPreAvgSubtr, "zdc_yCentroidPreAvgSubtr[2]/F");
280 m_outputTree->Branch("zdc_xCentroid", &t_xCentroid, "zdc_xCentroid[2]/F");
281 m_outputTree->Branch("zdc_yCentroid", &t_yCentroid, "zdc_yCentroid[2]/F");
282 m_outputTree->Branch("zdc_xRowCentroid", &t_xRowCentroid, "zdc_xRowCentroid[2][4]/F");
283 m_outputTree->Branch("zdc_yColCentroid", &t_yColCentroid, "zdc_yColCentroid[2][4]/F");
284 m_outputTree->Branch("zdc_reactionPlaneAngle", &t_reactionPlaneAngle, "zdc_reactionPlaneAngle[2]/F");
285 m_outputTree->Branch("zdc_cosDeltaReactionPlaneAngle", &t_cosDeltaReactionPlaneAngle, "zdc_cosDeltaReactionPlaneAngle/F");
286 }
287 }
288
289 if (!(zdcCalib || zdcLaser || zdcOnly || zdcInj))
290 {
291 m_outputTree->Branch("mbts_in_e", &t_mbts_in_e, "mbts_in_e[2][8]/F");
292 m_outputTree->Branch("mbts_in_t", &t_mbts_in_t, "mbts_in_t[2][8]/F");
293 m_outputTree->Branch("mbts_out_e", &t_mbts_out_e, "mbts_out_e[2][4]/F");
294 m_outputTree->Branch("mbts_out_t", &t_mbts_out_t, "mbts_out_t[2][4]/F");
295
296 m_outputTree->Branch("T2mbts_in_e", &t_T2mbts_in_e, "T2mbts_in_e[2][8]/F");
297 m_outputTree->Branch("T2mbts_in_t", &t_T2mbts_in_t, "T2mbts_in_t[2][8]/F");
298 m_outputTree->Branch("T2mbts_out_e", &t_T2mbts_out_e, "T2mbts_out_e[2][4]/F");
299 m_outputTree->Branch("T2mbts_out_t", &t_T2mbts_out_t, "T2mbts_out_t[2][4]/F");
300
301 m_outputTree->Branch("L1ET", &t_L1ET, "L1ET/F");
302 m_outputTree->Branch("L1ET24", &t_L1ET24, "L1ET24/F");
303
304 m_outputTree->Branch("totalEt", &t_totalEt, "totalEt/F");
305 m_outputTree->Branch("totalEt_TTsum", &t_totalEt_TTsum, "totalEt_TTsum/F");
306
307 m_outputTree->Branch("totalEt24", &t_totalEt24, "totalEt24/F");
308 m_outputTree->Branch("totalEt24_TTsum", &t_totalEt24_TTsum, "totalEt24_TTsum/F");
309
310 m_outputTree->Branch("fcalEt", &t_fcalEt, "fcalEt/F");
311 m_outputTree->Branch("fcalEtA", &t_fcalEtA, "fcalEtA/F");
312 m_outputTree->Branch("fcalEtC", &t_fcalEtC, "fcalEtC/F");
313 m_outputTree->Branch("fcalEtA_TT", &t_fcalEtA_TT, "fcalEtA_TT/F");
314 m_outputTree->Branch("fcalEtC_TT", &t_fcalEtC_TT, "fcalEtC_TT/F");
315
316 m_outputTree->Branch("nvx", &t_nvx, "nvx/I");
317 m_outputTree->Branch("vx", &t_vx, "vx[3]/F");
318 m_outputTree->Branch("pvindex", &t_pvindex, "pvindex/I");
319 m_outputTree->Branch("vxntrk", &t_vxntrk, "vxntrk/I");
320 m_outputTree->Branch("vx_trk_index", "vector<int>", &t_vx_trk_index);
321 m_outputTree->Branch("vxtype", &t_vxtype, "vxtype/I");
322 m_outputTree->Branch("vxcov", &t_vxcov, "vxcov[6]/F");
323 m_outputTree->Branch("vxsumpt2", &t_vxsumpt2, "vxsumpt2/F");
324 m_outputTree->Branch("nstrong", &t_nstrong, "nstrong/I");
325 m_outputTree->Branch("puvxntrk", &t_puvxntrk, "puvxntrk/I");
326 m_outputTree->Branch("puvxsumpt", &t_puvxsumpt, "puvxsumpt/F");
327 m_outputTree->Branch("puvxz", &t_puvxz, "puvxz/F");
328 m_outputTree->Branch("vxnlooseprimary", &t_vxnlooseprimary, "vxnlooseprimary/I");
329 m_outputTree->Branch("vxnminbias", &t_vxnminbias, "vxnminbias/I");
330 m_outputTree->Branch("vxngoodmuon", &t_vxngoodmuon, "vxngoodmuon/I");
331
332 m_outputTree->Branch("t_nvtx", &t_nvtx, "nvtx/I");
333 m_outputTree->Branch("vtx_type", "vector<int8_t>", &t_vtx_type);
334 m_outputTree->Branch("vtx_x", "vector<float>", &t_vtx_x);
335 m_outputTree->Branch("vtx_y", "vector<float>", &t_vtx_y);
336 m_outputTree->Branch("vtx_z", "vector<float>", &t_vtx_z);
337 m_outputTree->Branch("vtx_ntrk_all", "vector<int16_t>", &t_vtx_ntrk_all);
338 m_outputTree->Branch("vtx_sumpt2_all", "vector<float>", &t_vtx_sumpt2_all);
339 m_outputTree->Branch("vtx_ntrk", "vector<int16_t>", &t_vtx_ntrk);
340 m_outputTree->Branch("vtx_sumpt2", "vector<float>", &t_vtx_sumpt2);
341 m_outputTree->Branch("vtx_trk_index", "vector< vector<int16_t> >", &t_vtx_trk_index);
342
343 m_outputTree->Branch("mbts_countA", &t_mbts_countA, "mbts_countA/s");
344 m_outputTree->Branch("mbts_countC", &t_mbts_countC, "mbts_countC/s");
345 m_outputTree->Branch("T2mbts_countAin", &t_T2mbts_countAin, "T2mbts_countAin/s");
346 m_outputTree->Branch("T2mbts_countCin", &t_T2mbts_countCin, "T2mbts_countCin/s");
347 m_outputTree->Branch("mbts_timeA", &t_mbts_timeA, "mbts_timeA/F");
348 m_outputTree->Branch("mbts_timeC", &t_mbts_timeC, "mbts_timeC/F");
349 m_outputTree->Branch("mbts_timeDiff", &t_mbts_timeDiff, "mbts_timeDiff/F");
350
351 t_nclus = 0;
352 m_outputTree->Branch("nclus", &t_nclus, "nclus/i");
353 m_outputTree->Branch("clusEt", &t_clusEt, "clusEt/F");
354 m_outputTree->Branch("clusEtMax", &t_clusEtMax, "clusEtMax/F");
355 m_outputTree->Branch("clusetaMax", &t_clusetaMax, "clusetaMax/F");
356 m_outputTree->Branch("clusphiMax", &t_clusphiMax, "clusphiMax/F");
357
358 m_outputTree->Branch("cc_pt", "vector<float>", &t_cc_pt);
359 m_outputTree->Branch("cc_eta", "vector<float>", &t_cc_eta);
360 m_outputTree->Branch("cc_phi", "vector<float>", &t_cc_phi);
361 m_outputTree->Branch("cc_e", "vector<float>", &t_cc_e);
362 m_outputTree->Branch("cc_raw_m", "vector<float>", &t_cc_raw_m);
363 m_outputTree->Branch("cc_raw_eta", "vector<float>", &t_cc_raw_eta);
364 m_outputTree->Branch("cc_raw_phi", "vector<float>", &t_cc_raw_phi);
365 m_outputTree->Branch("cc_raw_e", "vector<float>", &t_cc_raw_e);
366 m_outputTree->Branch("cc_raw_samp", "vector<vector<float>>", &t_cc_raw_samp);
367 m_outputTree->Branch("cc_sig", "vector<float>", &t_cc_sig);
368 m_outputTree->Branch("cc_layer", "vector<int>", &t_cc_layer);
369
370 m_outputTree->Branch("edgeGapA", &t_edgeGapA, "edgeGapA/F");
371 m_outputTree->Branch("edgeGapC", &t_edgeGapC, "edgeGapC/F");
372
373 m_outputTree->Branch("ntrk", &t_ntrk, "ntrk/i");
374 if (enableTracks)
375 {
376 m_outputTree->Branch("trk_pt", "vector<float>", &t_trk_pt);
377 m_outputTree->Branch("trk_eta", "vector<float>", &t_trk_eta);
378 m_outputTree->Branch("trk_theta", "vector<float>", &t_trk_theta);
379 m_outputTree->Branch("trk_phi", "vector<float>", &t_trk_phi);
380 m_outputTree->Branch("trk_e", "vector<float>", &t_trk_e);
381 m_outputTree->Branch("trk_index", "vector<int>", &t_trk_index);
382 m_outputTree->Branch("trk_d0", "vector<float>", &t_trk_d0);
383 m_outputTree->Branch("trk_z0", "vector<float>", &t_trk_z0);
384 m_outputTree->Branch("trk_vz", "vector<float>", &t_trk_vz);
385 m_outputTree->Branch("trk_vtxz", "vector<float>", &t_trk_vtxz);
386 m_outputTree->Branch("trk_pixeldEdx", "vector<float>", &t_trk_pixeldEdx);
387 m_outputTree->Branch("trk_charge", "vector<int8_t>", &t_trk_charge);
388 m_outputTree->Branch("trk_quality", "vector<int16_t>", &t_trk_quality);
389 m_outputTree->Branch("trk_nPixHits", "vector<uint8_t>", &t_trk_nPixHits);
390 m_outputTree->Branch("trk_nSctHits", "vector<uint8_t>", &t_trk_nSctHits);
391 m_outputTree->Branch("trk_nPixDead", "vector<uint8_t>", &t_trk_nPixDead);
392 m_outputTree->Branch("trk_nSctDead", "vector<uint8_t>", &t_trk_nSctDead);
393 m_outputTree->Branch("trk_nPixHoles", "vector<uint8_t>", &t_trk_nPixHoles);
394 m_outputTree->Branch("trk_nSctHoles", "vector<uint8_t>", &t_trk_nSctHoles);
395 m_outputTree->Branch("trk_nTrtHits", "vector<uint8_t>", &t_trk_nTrtHits);
396 m_outputTree->Branch("trk_nTrtOutliers", "vector<uint8_t>", &t_trk_nTrtOutliers);
397 m_outputTree->Branch("trk_inPixHits", "vector<uint8_t>", &t_trk_inPixHits);
398 m_outputTree->Branch("trk_exPixHits", "vector<uint8_t>", &t_trk_exPixHits);
399 m_outputTree->Branch("trk_ninPixHits", "vector<uint8_t>", &t_trk_ninPixHits);
400 m_outputTree->Branch("trk_nexPixHits", "vector<uint8_t>", &t_trk_nexPixHits);
401 }
402
404 m_outputTree->Branch("nProtons", &nProtons, "nProtons/i");
405 m_outputTree->Branch("proton_pt", "vector<double>", &proton_pt);
406 m_outputTree->Branch("proton_eta", "vector<double>", &proton_eta);
407 m_outputTree->Branch("proton_phi", "vector<double>", &proton_phi);
408 m_outputTree->Branch("proton_e", "vector<double>", &proton_e);
409 m_outputTree->Branch("proton_side", "vector<int>", &proton_side);
410 m_outputTree->Branch("proton_eLoss", "vector<double>", &proton_eLoss);
411 m_outputTree->Branch("proton_t", "vector<double>", &proton_t);
412 m_outputTree->Branch("proton_track_stationID", "vector<vector<int>>", &proton_track_stationID);
413 m_outputTree->Branch("proton_track_nClusters", "vector<vector<int>>", &proton_track_nClusters);
414 m_outputTree->Branch("proton_track_xLocal", "vector<vector<float>>", &proton_track_xLocal);
415 m_outputTree->Branch("proton_track_yLocal", "vector<vector<float>>", &proton_track_yLocal);
416 m_outputTree->Branch("proton_track_zLocal", "vector<vector<float>>", &proton_track_zLocal);
417 m_outputTree->Branch("proton_track_xSlope", "vector<vector<float>>", &proton_track_xSlope);
418 m_outputTree->Branch("proton_track_ySlope", "vector<vector<float>>", &proton_track_ySlope);
419 }
420
421 }
422 }
423
424 ANA_MSG_DEBUG("Anti-howdy from Initialize!");
425
426
427 // Here you do everything that you need to do after the first input
428 // file has been connected and before the first event is processed,
429 // e.g. create additional histograms based on which variables are
430 // available in the input files. You can also create all of your
431 // histograms and trees in here, but be aware that this method
432 // doesn't get called if no events are processed. So any objects
433 // you create here won't be available in the output if you have no
434 // input events.
435
436 ANA_MSG_INFO("enableOutputTree = " << enableOutputTree);
437 ANA_MSG_INFO("writeOnlyTriggers = " << writeOnlyTriggers);
438 ANA_MSG_INFO("enableOutputSamples = " << enableOutputSamples);
439 ANA_MSG_INFO("enableTrigger = " << enableTrigger);
440 ANA_MSG_INFO("enableRPD = " << enableRPD);
441 ANA_MSG_INFO("enableCentroid = " << enableCentroid);
442 ANA_MSG_INFO("zdcCalib = " << zdcCalib);
443 ANA_MSG_INFO("zdcInj = " << zdcInj);
444 ANA_MSG_INFO("zdcLaser = " << zdcLaser);
445 ANA_MSG_INFO("zdcConfig = " << zdcConfig);
446 ANA_MSG_INFO("reprocZdc = " << reprocZdc);
447 ANA_MSG_INFO("auxSuffix = " << auxSuffix );
448 ANA_MSG_INFO("zdcLowGainMode = " << zdcLowGainMode);
449 ANA_MSG_INFO("enableID = " << enableID);
450 ANA_MSG_INFO("enableCalo = " << enableCalo);
451 ANA_MSG_INFO("enableClusters = " << enableClusters);
452 ANA_MSG_INFO("trackLimit = " << trackLimit);
453 ANA_MSG_INFO("trackLimitReject = " << trackLimitReject);
454 ANA_MSG_INFO("isMC = " << m_isMC);
455 ANA_MSG_INFO("useGRL = " << useGRL);
456 ANA_MSG_INFO("grlFilename = " << grlFilename);
457 ANA_MSG_INFO("slimmed = " << slimmed);
458 ANA_MSG_INFO("zdcOnly = " << zdcOnly);
459 ANA_MSG_INFO("flipDelay = " << flipDelay);
460 ANA_MSG_INFO("nsamplesZdc = " << nsamplesZdc);
461 ANA_MSG_INFO("lhcf2022 = " << lhcf2022);
462 ANA_MSG_INFO("lhcf2022afp = " << lhcf2022afp);
463 ANA_MSG_INFO("lhcf2022zdc = " << lhcf2022zdc);
464 ANA_MSG_INFO("doZdcCalib = " << doZdcCalib);
465
466 ANA_MSG_DEBUG("initialize: Initialize!");
467
468
469 // GRL
470
471 if (useGRL)
472 {
473 const char* fullGRLFilePath = gSystem->ExpandPathName (grlFilename.c_str());
474 ANA_MSG_INFO("GRL: " << fullGRLFilePath);
475 std::vector<std::string> vecStringGRL;
476 vecStringGRL.push_back(fullGRLFilePath);
477 ANA_CHECK(m_grl.setProperty( "GoodRunsListVec", vecStringGRL));
478 ANA_CHECK(m_grl.setProperty("PassThrough", false)); // if true (default) will ignore result of GRL and will just pass all events
479 ANA_CHECK(m_grl.initialize());
480
481 }
482
483 if (enableTracks)
484 {
485 ANA_CHECK(m_selTool.retrieve());
486 }
487
488 if (enableTrigger) // HLT related
489 {
490 ANA_MSG_INFO("Trying to initialize TDT");
491 ANA_CHECK(m_trigDecisionTool.retrieve());
492 }
493
494 // ZDC re-reco tool
495 if (reprocZdc)
496 {
497 m_zdcAnalysisTool.setTypeAndName("ZDC::ZdcAnalysisTool/ZdcAnalysisTool");
498
499 ANA_MSG_INFO("Trying to configure ZDC Analysis Tool!");
500
501 ANA_CHECK(m_zdcAnalysisTool.setProperty("FlipEMDelay", flipDelay));
502 ANA_CHECK(m_zdcAnalysisTool.setProperty("LowGainMode", zdcLowGainMode));
503 ANA_CHECK(m_zdcAnalysisTool.setProperty("DoCalib", doZdcCalib));
504 ANA_CHECK(m_zdcAnalysisTool.setProperty("Configuration", zdcConfig));
505 ANA_CHECK(m_zdcAnalysisTool.setProperty("AuxSuffix", auxSuffix));
506 ANA_CHECK(m_zdcAnalysisTool.setProperty("ForceCalibRun", -1));
507
508 ANA_MSG_INFO("Setting up zdcConfig=" << zdcConfig);
509 if (zdcConfig=="LHCf2022")
510 {
511 ANA_CHECK(m_zdcAnalysisTool.setProperty("DoTrigEff", false)); // for now
512 ANA_CHECK(m_zdcAnalysisTool.setProperty("DoTimeCalib", false)); // for now
513 ANA_CHECK(m_zdcAnalysisTool.setProperty("Configuration", "LHCf2022"));
514 }
515 else if (zdcConfig == "PbPb2018")
516 {
517 ANA_CHECK(m_zdcAnalysisTool.setProperty("Configuration", "PbPb2018"));
518 }
519 else if (zdcConfig == "pPb2016")
520 {
521 ANA_CHECK(m_zdcAnalysisTool.setProperty("Configuration", "pPb2016"));
522 }
523 else if (zdcConfig == "PbPb2015")
524 {
525 ANA_CHECK(m_zdcAnalysisTool.setProperty("Configuration", "PbPb2015"));
526 }
527 else if (zdcConfig == "OONeNe2025")
528 {
529 ANA_CHECK(m_zdcAnalysisTool.setProperty("DoTrigEff", false)); // for now
530 ANA_CHECK(m_zdcAnalysisTool.setProperty("DoTimeCalib", true)); // for now
531 ANA_CHECK(m_zdcAnalysisTool.setProperty("Configuration", "OONeNe2025"));
532 }
533
534 if (flipDelay)
535 ANA_MSG_INFO("FLIP ZDC DELAY IN EM MODULES");
536 else
537 ANA_MSG_INFO("NO FLIP ZDC DELAY IN EM MODULES");
538
539
540 ANA_MSG_INFO("Trying to initialize ZDC Analysis Tool!");
541 ANA_CHECK(m_zdcAnalysisTool.initialize());
542 }
543
544 if (zdcInj)
545 {
546 m_zdcInjPulserAmpMap = std::make_shared<ZdcInjPulserAmpMap>();
547 ATH_MSG_INFO( "Using JSON file for injector-pulse voltage at path " << m_zdcInjPulserAmpMap->getFilePath() );
548 }
549
550 return StatusCode::SUCCESS;
551}
552
553
554
555StatusCode ZdcNtuple :: execute ()
556{
557 // Here you do everything that needs to be done on every single
558 // events, e.g. read input variables, apply cuts, and fill
559 // histograms and trees. This is where most of your actual analysis
560 // code will go.
561
562
563 // prefilter with a track limit
564
565 if (!evtStore())
566 {
567 ANA_MSG_INFO("*** No event found! ***");
568 return StatusCode::SUCCESS;
569 }
570
571 ANA_CHECK(evtStore()->retrieve( m_eventInfo, "EventInfo"));
573 if (zdcInj){
575 }
576
577 bool passTrigger = true;
578 m_trigDecision = 0;
579 if (enableTrigger)
580 {
581 ANA_CHECK(evtStore()->retrieve( m_trigDecision, "xTrigDecision"));
583 passTrigger = processTriggerDecision();
584 }
585
586 // if trigger enabled, only write out events which pass one of them, unless using MC
587 //
588 if (enableTrigger && !passTrigger && !m_isMC && writeOnlyTriggers) {
589 ANA_MSG_DEBUG ("Event failed trigger");
590 return StatusCode::SUCCESS;
591 }
592
593 if (reprocZdc){
594 ANA_MSG_INFO ("Reprocessing ZDC in ZdcNtuple");
595 ANA_CHECK(m_zdcAnalysisTool->reprocessZdc());
596 }else{
597 ANA_MSG_DEBUG ("No ZDC reprocessing");
598 }
599
600 processZdcNtupleFromModules(); // same model in both cases -- processZdcNtuple() goes straight to the anlaysis tool, which is good for debugging
601
602 if(m_isMC){
604 }
605
606 //tracks used to go here
607
609
610 if ((!(zdcCalib || zdcLaser || zdcOnly || zdcInj)) && enableID)
611 {
612 ANA_MSG_DEBUG("Trying to extract InDetTrackParticles from evtStore()=" << evtStore());
613 ANA_CHECK(evtStore()->retrieve( m_trackParticles, "InDetTrackParticles") );
614 size_t n = m_trackParticles->size();
615 ANA_MSG_DEBUG("Done w/ extracting InDetTrackParticles with size = " << n);
616
617 if (n > trackLimit && trackLimitReject) return StatusCode::SUCCESS;
618 }
619
620 if (!(zdcCalib || zdcLaser || zdcOnly || zdcInj))
621 {
622
623 // PLEASE NOTE: the commented sections here will be restored once we have a better sense of the Run 3 HI data
624
625 // Global E_T quantities for centrality
626 if (enableCalo){
627 ANA_CHECK(evtStore()->retrieve( m_caloSums, "CaloSums") );
628 ANA_CHECK(evtStore()->retrieve( m_eventShapes, "HIEventShape") );
629
631 ANA_CHECK(evtStore()->retrieve( m_lvl1EnergySumRoI, "LVL1EnergySumRoI") );
632
633 processFCal();
634 }
635
636 // MBTS quantities, but may require a derivation to be accessible (required STDM6 in pp)
637 //ANA_CHECK(evtStore()->retrieve( m_mbtsInfo, "MBTSForwardEventInfo") );
638 //ANA_CHECK(evtStore()->retrieve( m_mbtsModules, "MBTSModules") );
639 //m_trigT2MbtsBits = 0;
640 //ANA_CHECK(evtStore()->retrieve( m_trigT2MbtsBits, "HLT_xAOD__TrigT2MbtsBitsContainer_T2Mbts") );
641 //processMBTS();
642
643 if (enableID){
644 ANA_CHECK(evtStore()->retrieve( m_primaryVertices, "PrimaryVertices") );
645 processInDet();
646 }
647
648
649 if (enableClusters){
650 ANA_CHECK(evtStore()->retrieve( m_caloClusters, "CaloCalTopoClusters"));
652 }
653
654 // Gaps will require some evaluation of Run 3 performance of the clusters
655 processGaps();
656
658 ANA_CHECK(evtStore()->retrieve( m_afpProtons, "AFPProtonContainer"));
660 }
661 }
662
664 {
665 tree( "zdcTree" )->Fill();
666 }
667
668 return StatusCode::SUCCESS;
669}
670
672{
673
676
677 ANA_MSG_DEBUG ("copying already processed info!");
678
679 //Reset the truth separately since it has a different range
680 for(int iside : {0,1}){
681 for(int imod = 0; imod < 7; ++imod){
682 t_ZdcModuleTruthTotal[iside][imod] = 0;
683 t_ZdcModuleTruthInvis[iside][imod] = 0;
684 t_ZdcModuleTruthEM[iside][imod] = 0;
685 t_ZdcModuleTruthNonEM[iside][imod] = 0;
686 t_ZdcModuleTruthEscaped[iside][imod] = 0;
687 t_ZdcModuleTruthNphotons[iside][imod] = 0;
688 }
689 for(int ch = 0; ch < 16; ++ch){
690 t_RpdModuleTruthNphotons[iside][ch] = 0;
691 }
692 }
693
694 for (size_t iside = 0; iside < 2; iside++)
695 {
696 t_ZdcAmp[iside] = 0; t_ZdcEnergy[iside] = 0; t_ZdcEnergyErr[iside] = 0;t_ZdcTime[iside] = 0; t_ZdcStatus[iside] = 0;
697 t_ZdcNLEnergy[iside] = 0;t_ZdcNLEnergyErr[iside] = 0;
698 t_ZdcTrigEff[iside] = 0;t_ZdcLucrodTriggerSideAmp[iside] = 0; t_ZdcLucrodTriggerSideAmpLG[iside] = 0; t_ZdcTruthTotal[iside] = 0;
699 t_ZdcTruthInvis[iside] = 0; t_ZdcTruthEM[iside] = 0; t_ZdcTruthNonEM[iside] = 0;
700 t_ZdcTruthEscaped[iside] = 0;
701 for (int imod = 0; imod < 4; imod++)
702 {
703 t_ZdcModuleAmp[iside][imod] = 0; t_ZdcModuleAmpUncorr[iside][imod] = 0;
704 t_ZdcModuleTime[iside][imod] = 0; t_ZdcModuleStatus[iside][imod] = 0;
705
706 t_ZdcModuleCalibAmp[iside][imod] = 0; t_ZdcModuleCalibTime[iside][imod] = 0; t_ZdcModuleChisq[iside][imod] = 0; t_ZdcModuleChisqRatio[iside][imod] = 0; t_ZdcModuleFitAmp[iside][imod] = 0;
707 t_ZdcModuleFitT0[iside][imod] = 0; t_ZdcModuleBkgdMaxFraction[iside][imod] = 0; t_ZdcModuleAmpError[iside][imod] = 0;
708 t_ZdcModuleMinDeriv2nd[iside][imod] = 0; t_ZdcModulePresample[iside][imod] = 0; t_ZdcModulePreSampleAmp[iside][imod] = 0;
709 t_ZdcLucrodTriggerAmp[iside][imod] = 0;t_ZdcLucrodTriggerAmpLG[iside][imod] = 0;
710 t_ZdcModuleMaxADC[iside][imod] = 0; t_ZdcModuleMaxADCHG[iside][imod] = 0; t_ZdcModuleMaxADCLG[iside][imod] = 0;
711 t_ZdcModulePeakADCHG[iside][imod] = 0; t_ZdcModulePeakADCLG[iside][imod] = 0;
712 t_ZdcModuleAmpLGRefit[iside][imod] = 0; t_ZdcModuleAmpCorrLGRefit[iside][imod] = 0;
713 t_ZdcModuleT0LGRefit[iside][imod] = 0; t_ZdcModuleT0SubLGRefit[iside][imod] = 0; t_ZdcModuleChisqLGRefit[iside][imod] = 0;
714
716 {
717 for (int ig=0;ig<2;ig++)
718 {
719 for (int id=0;id<2;id++)
720 {
721 for (unsigned int isamp=0;isamp<nsamplesZdc;isamp++)
722 {
723 if (nsamplesZdc==7) t_raw7[iside][imod][ig][id][isamp]=0;
724 if (nsamplesZdc==15) t_raw15[iside][imod][ig][id][isamp]=0;
725 if (nsamplesZdc==24) t_raw24[iside][imod][ig][id][isamp]=0;
726 if (nsamplesZdc==32) t_raw32[iside][imod][ig][id][isamp]=0;
727 if (nsamplesZdc==40) t_raw40[iside][imod][ig][id][isamp]=0;
728 }
729 }
730 }
731 if (nsamplesZdc==24||nsamplesZdc==32||nsamplesZdc==40)
732 {
733 for (int ch=0;ch<16;ch++)
734 {
735 for (unsigned int isamp=0;isamp<nsamplesZdc;isamp++)
736 {
737 t_rpdRaw[iside][ch][isamp]=0;
738 }
739 }
740 }
741 }
742 if (enableRPD)
743 {
744 for (int ch = 0; ch < 16; ch++) {
745 t_RpdChannelBaseline[iside][ch] = 0;
746 std::fill(t_RpdChannelPileupExpFitParams[iside][ch], t_RpdChannelPileupExpFitParams[iside][ch] + 2, 0);
748 std::fill(t_RpdChannelPileupExpFitParamErrs[iside][ch], t_RpdChannelPileupExpFitParamErrs[iside][ch] + 2, 0);
750 t_RpdChannelPileupExpFitMSE[iside][ch] = 0;
752 t_RpdChannelAmplitude[iside][ch] = 0;
753 t_RpdChannelAmplitudeCalib[iside][ch] = 0;
754 t_RpdChannelMaxADC[iside][ch] = 0;
755 t_RpdChannelMaxADCCalib[iside][ch] = 0;
756 t_RpdChannelMaxSample[iside][ch] = 0;
757 t_RpdChannelStatus[iside][ch] = 0;
758 t_RpdChannelPileupFrac[iside][ch] = 0;
759 }
760 t_RpdSideStatus[iside] = 0;
761 }
762 if (enableCentroid)
763 {
764 t_centroidStatus[iside] = 0;
765 std::fill(t_RPDChannelSubtrAmp[iside], t_RPDChannelSubtrAmp[iside] + 16, 0);
766 t_RPDSubtrAmpSum[iside] = 0;
769 t_xCentroidPreAvgSubtr[iside] = 0;
770 t_yCentroidPreAvgSubtr[iside] = 0;
771 t_xCentroid[iside] = 0;
772 t_yCentroid[iside] = 0;
773 std::fill(t_xRowCentroid[iside], t_xRowCentroid[iside] + 4, 0);
774 std::fill(t_yColCentroid[iside], t_yColCentroid[iside] + 4, 0);
775 t_reactionPlaneAngle[iside] = 0;
776 }
777 }
778 }
779
780 t_ZdcModuleMask = 0;
781 if (enableCentroid) {
783 t_centroidEventValid = false;
785 }
786
787 /*
788 if (t_zdcEventInfoError == xAOD::EventInfo::Error)
789 {
790 ANA_MSG_INFO("ZDC event failed EventInfo error check - aborting!");
791 return;
792 }
793 */
794
795 static const SG::ConstAccessor<char> centroidEventValidAcc("centroidEventValid" + auxSuffix);
796 static const SG::ConstAccessor<float> cosDeltaReactionPlaneAngleAcc("cosDeltaReactionPlaneAngle" + auxSuffix);
797 static const SG::ConstAccessor<float> CalibEnergyAcc("CalibEnergy"+auxSuffix);
798 static const SG::ConstAccessor<float> CalibEnergyErrAcc("CalibEnergyErr"+auxSuffix);
799 static const SG::ConstAccessor<float> NLCalibEnergyAcc("NLCalibEnergy"+auxSuffix);
800 static const SG::ConstAccessor<float> NLCalibEnergyErrAcc("NLCalibEnergyErr"+auxSuffix);
801 static const SG::ConstAccessor<float> UncalibSumAcc("UncalibSum"+auxSuffix);
802 static const SG::ConstAccessor<float> UncalibSumErrAcc("UncalibSumErr"+auxSuffix);
803 static const SG::ConstAccessor<float> AverageTimeAcc("AverageTime"+auxSuffix);
804 static const SG::ConstAccessor<unsigned int> StatusAcc("Status"+auxSuffix);
805 static const SG::ConstAccessor<unsigned int> ModuleMaskAcc("ModuleMask"+auxSuffix);
806 static const SG::ConstAccessor<float> TruthTotalEnergyAcc("TruthTotalEnergy" + auxSuffix);
807 static const SG::ConstAccessor<float> TruthInvisibleEnergyAcc("TruthInvisibleEnergy" + auxSuffix);
808 static const SG::ConstAccessor<float> TruthEMEnergyAcc("TruthEMEnergy" + auxSuffix);
809 static const SG::ConstAccessor<float> TruthNonEMEnergyAcc("TruthNonEMEnergy" + auxSuffix);
810 static const SG::ConstAccessor<float> TruthEscapedEnergyAcc("TruthEscapedEnergy" + auxSuffix);
811 static const SG::ConstAccessor<unsigned int> centroidStatusAcc("centroidStatus" + auxSuffix);
812 static const SG::ConstAccessor<std::vector<float> > RPDChannelSubtrAmpAcc("RPDChannelSubtrAmp" + auxSuffix);
813 static const SG::ConstAccessor<float> RPDSubtrAmpSumAcc("RPDSubtrAmpSum" + auxSuffix);
814 static const SG::ConstAccessor<float> xCentroidPreGeomCorPreAvgSubtrAcc("xCentroidPreGeomCorPreAvgSubtr" + auxSuffix);
815 static const SG::ConstAccessor<float> yCentroidPreGeomCorPreAvgSubtrAcc("yCentroidPreGeomCorPreAvgSubtr" + auxSuffix);
816 static const SG::ConstAccessor<float> xCentroidPreAvgSubtrAcc("xCentroidPreAvgSubtr" + auxSuffix);
817 static const SG::ConstAccessor<float> yCentroidPreAvgSubtrAcc("yCentroidPreAvgSubtr" + auxSuffix);
818 static const SG::ConstAccessor<float> xCentroidAcc("xCentroid" + auxSuffix);
819 static const SG::ConstAccessor<float> yCentroidAcc("yCentroid" + auxSuffix);
820 static const SG::ConstAccessor<std::vector<float> > xRowCentroidAcc("xRowCentroid" + auxSuffix);
821 static const SG::ConstAccessor<std::vector<float> > yColCentroidAcc("yColCentroid" + auxSuffix);
822 static const SG::ConstAccessor<float> reactionPlaneAngleAcc("reactionPlaneAngle" + auxSuffix);
823 static const SG::ConstAccessor<unsigned int> RPDStatusAcc("RPDStatus" + auxSuffix);
824 static const SG::ConstAccessor<unsigned int> nPhotonsAcc("nPhotons" + auxSuffix);
825 static const SG::ConstAccessor<float> CalibTimeAcc("CalibTime" + auxSuffix);
826 static const SG::ConstAccessor<float> AmplitudeAcc("Amplitude" + auxSuffix);
827 static const SG::ConstAccessor<float> AmplitudeNoNonLinAcc("AmpNoNonLin" + auxSuffix);
828 static const SG::ConstAccessor<float> TimeAcc("Time" + auxSuffix);
829 static const SG::ConstAccessor<float> ChisqAcc("Chisq" + auxSuffix);
830 static const SG::ConstAccessor<float> ChisqRatioAcc("ChisqRatio" + auxSuffix);
831 static const SG::ConstAccessor<float> FitAmpAcc("FitAmp" + auxSuffix);
832 static const SG::ConstAccessor<float> FitAmpErrorAcc("FitAmpError" + auxSuffix);
833 static const SG::ConstAccessor<float> FitT0Acc("FitT0" + auxSuffix);
834 static const SG::ConstAccessor<float> BkgdMaxFractionAcc("BkgdMaxFraction" + auxSuffix);
835 static const SG::ConstAccessor<float> MinDeriv2ndAcc("MinDeriv2nd" + auxSuffix);
836 static const SG::ConstAccessor<float> PresampleAcc("Presample" + auxSuffix);
837 static const SG::ConstAccessor<float> PreSampleAmpAcc("PreSampleAmp" + auxSuffix);
838 static const SG::ConstAccessor<float> RPDChannelBaselineAcc("RPDChannelBaseline" + auxSuffix);
839 static const SG::ConstAccessor<std::vector<float> > RPDChannelPileupExpFitParamsAcc("RPDChannelPileupExpFitParams" + auxSuffix);
840 static const SG::ConstAccessor<std::vector<float> > RPDChannelPileupExpFitParamErrsAcc("RPDChannelPileupExpFitParamErrs" + auxSuffix);
841 static const SG::ConstAccessor<std::vector<float> > RPDChannelPileupStretchedExpFitParamsAcc("RPDChannelPileupStretchedExpFitParams" + auxSuffix);
842 static const SG::ConstAccessor<std::vector<float> > RPDChannelPileupStretchedExpFitParamErrsAcc("RPDChannelPileupStretchedExpFitParamErrs" + auxSuffix);
843 static const SG::ConstAccessor<float> RPDChannelPileupExpFitMSEAcc("RPDChannelPileupExpFitMSE" + auxSuffix);
844 static const SG::ConstAccessor<float> RPDChannelPileupStretchedExpFitMSEAcc("RPDChannelPileupStretchedExpFitMSE" + auxSuffix);
845 static const SG::ConstAccessor<float> RPDChannelAmplitudeAcc("RPDChannelAmplitude" + auxSuffix);
846 static const SG::ConstAccessor<float> RPDChannelAmplitudeCalibAcc("RPDChannelAmplitudeCalib" + auxSuffix);
847 static const SG::ConstAccessor<float> RPDChannelMaxADCAcc("RPDChannelMaxADC" + auxSuffix);
848 static const SG::ConstAccessor<float> RPDChannelMaxADCCalibAcc("RPDChannelMaxADCCalib" + auxSuffix);
849 static const SG::ConstAccessor<unsigned int> RPDChannelMaxSampleAcc("RPDChannelMaxSample" + auxSuffix);
850 static const SG::ConstAccessor<unsigned int> RPDChannelStatusAcc("RPDChannelStatus" + auxSuffix);
851 static const SG::ConstAccessor<float> RPDChannelPileupFracAcc("RPDChannelPileupFrac" + auxSuffix);
852 static const SG::ConstAccessor<float> AmpLGRefitAcc("AmpLGRefit" + auxSuffix);
853 static const SG::ConstAccessor<float> T0LGRefitAcc("T0LGRefit" + auxSuffix);
854 static const SG::ConstAccessor<float> T0SubLGRefitAcc("T0SubLGRefit" + auxSuffix);
855 static const SG::ConstAccessor<float> ChisqLGRefitAcc("ChisqLGRefit" + auxSuffix);
856
857 static const SG::ConstAccessor<uint16_t> LucrodTriggerAmpAcc("LucrodTriggerAmp");
858 static const SG::ConstAccessor<uint16_t> LucrodTriggerAmpLGAcc("LucrodTriggerAmpLG");
859 static const SG::ConstAccessor<uint16_t> LucrodTriggerSideAmpAcc("LucrodTriggerSideAmp");
860 static const SG::ConstAccessor<uint16_t> LucrodTriggerSideAmpLGAcc("LucrodTriggerSideAmpLG");
861 static const SG::ConstAccessor<float> Amplitude0Acc("Amplitude");
862 static const SG::ConstAccessor<float> MaxADCAcc("MaxADC");
863 static const SG::ConstAccessor<float> MaxADCHGAcc("MaxADCHG");
864 static const SG::ConstAccessor<float> MaxADCLGAcc("MaxADCLG");
865 static const SG::ConstAccessor<float> PeakADCHGAcc("PeakADCHG");
866 static const SG::ConstAccessor<float> PeakADCLGAcc("PeakADCLG");
867 static const SG::ConstAccessor<std::vector<uint16_t> > g0d0DataAcc("g0d0Data");
868 static const SG::ConstAccessor<std::vector<uint16_t> > g0d1DataAcc("g0d1Data");
869 static const SG::ConstAccessor<std::vector<uint16_t> > g1d0DataAcc("g1d0Data");
870 static const SG::ConstAccessor<std::vector<uint16_t> > g1d1DataAcc("g1d1Data");
871 static const SG::ConstAccessor<std::vector<uint16_t> > g0dataAcc("g0data");
872 static const SG::ConstAccessor<std::vector<uint16_t> > g1dataAcc("g1data");
873
876 t_rpdDecodingError = rpdErr;
877 t_zdcDecodingError = zdcErr;
878 if (enableCentroid) {
879 // locate global sum (only if centroid is needed)
880 xAOD::ZdcModule const * globalSum = nullptr;
881 for (auto const * zdcSum : *zdcSums) {
882 if (zdcSum->zdcSide() == 0) {
883 globalSum = zdcSum;
884 break;
885 }
886 }
887 if (!globalSum) {
888 ANA_MSG_ERROR("unable to locate global ZdcSum (side = 0)");
890 }
891 else {
892 t_centroidDecorationsAvailable = centroidStatusAcc.isAvailable(*globalSum);
893 }
894 }
895
896 if (rpdErr||zdcErr) ANA_MSG_WARNING( "Decoding errors ZDC=" << zdcErr << " RPD=" << rpdErr );
897
898 if (zdcSums.ptr())
899 {
900 ANA_MSG_DEBUG( "accessing ZdcSums" );
901 for (const auto zdcSum : *zdcSums)
902 {
903 if (zdcSum->zdcSide()==0) {
904 // trap new global sum
906 t_centroidEventValid = centroidEventValidAcc(*zdcSum);
907 t_cosDeltaReactionPlaneAngle = cosDeltaReactionPlaneAngleAcc(*zdcSum);
908 }
909 // no other branches are filled from global sum - skip to the real sides (C=-1 and A=1)
910 continue;
911 }
912 int iside = 0;
913 if (zdcSum->zdcSide() > 0) iside = 1;
914
915 //static SG::AuxElement::ConstAccessor< float > acc( "CalibEnergy" );
916 //t_ZdcEnergy[iside] = acc(*zdcSum);
917
918 if (enableZDC && !zdcErr)
919 {
920 t_ZdcEnergy[iside] = CalibEnergyAcc(*zdcSum);
921 t_ZdcEnergyErr[iside] = CalibEnergyErrAcc(*zdcSum);
922 if (NLCalibEnergyAcc.isAvailable(*zdcSum)) {
923 t_ZdcNLEnergy[iside] = NLCalibEnergyAcc(*zdcSum);
924 t_ZdcNLEnergyErr[iside] = NLCalibEnergyErrAcc(*zdcSum);
925 }
926 t_ZdcAmp[iside] = UncalibSumAcc(*zdcSum);
927 t_ZdcAmpErr[iside] = UncalibSumErrAcc(*zdcSum);
928 if (LucrodTriggerSideAmpAcc.isAvailable(*zdcSum))
929 t_ZdcLucrodTriggerSideAmp[iside] = LucrodTriggerSideAmpAcc(*zdcSum);
930 if (LucrodTriggerSideAmpLGAcc.isAvailable(*zdcSum))
931 t_ZdcLucrodTriggerSideAmpLG[iside] = LucrodTriggerSideAmpLGAcc(*zdcSum);
932
933 ANA_MSG_VERBOSE("processZdcNtupleFromModules: ZdcSum energy = " << t_ZdcEnergy[iside]);
934
935 t_ZdcTime[iside] = AverageTimeAcc(*zdcSum);
936 t_ZdcStatus[iside] = StatusAcc(*zdcSum);
937 t_ZdcModuleMask += ( ModuleMaskAcc(*zdcSum) << 4 * iside);
938
939 if(m_isMC){
940 ANA_MSG_DEBUG("Filling sum truth");
941 t_ZdcTruthTotal [iside] = TruthTotalEnergyAcc(*zdcSum);
942 t_ZdcTruthInvis [iside] = TruthInvisibleEnergyAcc(*zdcSum);
943 t_ZdcTruthEM [iside] = TruthEMEnergyAcc(*zdcSum);
944 t_ZdcTruthNonEM [iside] = TruthNonEMEnergyAcc(*zdcSum);
945 t_ZdcTruthEscaped[iside] = TruthEscapedEnergyAcc(*zdcSum);
946 }
947
948 }
949
950 if (enableRPD)
951 {
952 if (enableRPDAmp && !rpdErr)
953 {
954 t_RpdSideStatus[iside] = RPDStatusAcc(*zdcSum);
955 }
957 {
958 t_centroidStatus[iside] = centroidStatusAcc(*zdcSum);
959 std::vector<float> const& rpdChannelSubtrAmp = RPDChannelSubtrAmpAcc(*zdcSum);
960 std::copy(rpdChannelSubtrAmp.begin(), rpdChannelSubtrAmp.end(), t_RPDChannelSubtrAmp[iside]);
961 t_RPDSubtrAmpSum[iside] = RPDSubtrAmpSumAcc(*zdcSum);
962 t_xCentroidPreGeomCorPreAvgSubtr[iside] = xCentroidPreGeomCorPreAvgSubtrAcc(*zdcSum);
963 t_yCentroidPreGeomCorPreAvgSubtr[iside] = yCentroidPreGeomCorPreAvgSubtrAcc(*zdcSum);
964 t_xCentroidPreAvgSubtr[iside] = xCentroidPreAvgSubtrAcc(*zdcSum);
965 t_yCentroidPreAvgSubtr[iside] = yCentroidPreAvgSubtrAcc(*zdcSum);
966 t_xCentroid[iside] = xCentroidAcc(*zdcSum);
967 t_yCentroid[iside] = yCentroidAcc(*zdcSum);
968 std::vector<float> const& xRowCentroid = xRowCentroidAcc(*zdcSum);
969 std::copy(xRowCentroid.begin(), xRowCentroid.end(), t_xRowCentroid[iside]);
970 std::vector<float> const& yColCentroid = yColCentroidAcc(*zdcSum);
971 std::copy(yColCentroid.begin(), yColCentroid.end(), t_yColCentroid[iside]);
972 t_reactionPlaneAngle[iside] = reactionPlaneAngleAcc(*zdcSum);
973 }
974 }
975 }
976 }
977
978 ANA_MSG_DEBUG( "accessing ZdcModules" );
979
980 if (zdcModules.ptr())
981 {
982 for (const auto zdcMod : *zdcModules)
983 {
984 int iside = 0;
985 if (zdcMod->zdcSide() > 0) iside = 1;
986 int imod = zdcMod->zdcModule();
987
988 if (m_isMC){
989 //Calib hits are only stored in channel 0 of the RPD
990 if(!(imod == 4 && zdcMod->zdcChannel() != 0)){
991 t_ZdcModuleTruthTotal [iside][imod] = TruthTotalEnergyAcc(*zdcMod);
992 t_ZdcModuleTruthInvis [iside][imod] = TruthInvisibleEnergyAcc(*zdcMod);
993 t_ZdcModuleTruthEM [iside][imod] = TruthEMEnergyAcc(*zdcMod);
994 t_ZdcModuleTruthNonEM [iside][imod] = TruthNonEMEnergyAcc(*zdcMod);
995 t_ZdcModuleTruthEscaped[iside][imod] = TruthEscapedEnergyAcc(*zdcMod);
996 t_ZdcModuleTruthNphotons[iside][imod] = nPhotonsAcc(*zdcMod);
997 }
998 //Calib hits are stored for all modules
999 //Other data is only valid for module 1-4
1000 if(imod > 4) continue;
1001 }
1002
1003 ANA_MSG_VERBOSE ("Module " << zdcMod->zdcSide() << " " << zdcMod->zdcModule() << " amp:" << AmplitudeAcc(*zdcMod));
1004
1005 if (zdcMod->zdcType() == 0 && !zdcErr)
1006 {
1007 // ZDC energy type modules
1008 t_ZdcModuleCalibAmp[iside][imod] = CalibEnergyAcc(*zdcMod);
1009 t_ZdcModuleCalibTime[iside][imod] = CalibTimeAcc(*zdcMod);
1010 t_ZdcModuleStatus[iside][imod] = StatusAcc(*zdcMod);
1011 if (t_ZdcModuleAmp[iside][imod] != 0.)
1012 Warning("processZdcNtupleFromModules", "overwriting side %d module %d!", iside, imod);
1013 t_ZdcModuleAmp[iside][imod] = AmplitudeAcc(*zdcMod);
1014 t_ZdcModuleAmpUncorr[iside][imod] = AmplitudeNoNonLinAcc(*zdcMod);
1015 t_ZdcModuleTime[iside][imod] = TimeAcc(*zdcMod);
1016
1017 t_ZdcModuleChisq[iside][imod] = ChisqAcc(*zdcMod);
1018 t_ZdcModuleChisqRatio[iside][imod] = ChisqRatioAcc(*zdcMod);
1019 t_ZdcModuleFitAmp[iside][imod] = FitAmpAcc(*zdcMod);
1020 t_ZdcModuleAmpError[iside][imod] = FitAmpErrorAcc(*zdcMod);
1021 t_ZdcModuleFitT0[iside][imod] = FitT0Acc(*zdcMod);
1022 t_ZdcModuleBkgdMaxFraction[iside][imod] = BkgdMaxFractionAcc(*zdcMod);
1023 t_ZdcModuleMinDeriv2nd[iside][imod] = MinDeriv2ndAcc(*zdcMod);
1024 t_ZdcModulePresample[iside][imod] = PresampleAcc(*zdcMod);
1025 t_ZdcModulePreSampleAmp[iside][imod] = PreSampleAmpAcc(*zdcMod);
1026
1027 if (AmpLGRefitAcc.isAvailable(*zdcMod)) {
1028 t_ZdcModuleAmpLGRefit[iside][imod] = AmpLGRefitAcc(*zdcMod);
1029 t_ZdcModuleT0LGRefit[iside][imod] = T0LGRefitAcc(*zdcMod);
1030 t_ZdcModuleT0SubLGRefit[iside][imod] = T0SubLGRefitAcc(*zdcMod);
1031 t_ZdcModuleChisqLGRefit[iside][imod] = ChisqLGRefitAcc(*zdcMod);
1032 }
1033
1034 if (LucrodTriggerAmpAcc.isAvailable(*zdcMod))
1035 t_ZdcLucrodTriggerAmp[iside][imod] = LucrodTriggerAmpAcc(*zdcMod);
1036 if (LucrodTriggerAmpLGAcc.isAvailable(*zdcMod))
1037 t_ZdcLucrodTriggerAmpLG[iside][imod] = LucrodTriggerAmpLGAcc(*zdcMod);
1038
1039 if (MaxADCAcc.isAvailable(*zdcMod))
1040 t_ZdcModuleMaxADC[iside][imod] = MaxADCAcc(*zdcMod);
1041 if (MaxADCHGAcc.isAvailable(*zdcMod))
1042 t_ZdcModuleMaxADCHG[iside][imod] = MaxADCHGAcc(*zdcMod);
1043 if (MaxADCLGAcc.isAvailable(*zdcMod))
1044 t_ZdcModuleMaxADCLG[iside][imod] = MaxADCLGAcc(*zdcMod);
1045 if (PeakADCHGAcc.isAvailable(*zdcMod))
1046 t_ZdcModulePeakADCHG[iside][imod] = PeakADCHGAcc(*zdcMod);
1047 if (PeakADCLGAcc.isAvailable(*zdcMod))
1048 t_ZdcModulePeakADCLG[iside][imod] = PeakADCLGAcc(*zdcMod);
1049
1050 if (enableOutputSamples && !zdcErr)
1051 {
1052 for (unsigned int isamp = 0; isamp < nsamplesZdc; isamp++) // 7 samples
1053 {
1054 if (nsamplesZdc == 7)
1055 {
1056 t_raw7[iside][imod][0][0][isamp] = g0d0DataAcc(*zdcMod).at(isamp);
1057 t_raw7[iside][imod][0][1][isamp] = g0d1DataAcc(*zdcMod).at(isamp);
1058 t_raw7[iside][imod][1][0][isamp] = g1d0DataAcc(*zdcMod).at(isamp);
1059 t_raw7[iside][imod][1][1][isamp] = g1d1DataAcc(*zdcMod).at(isamp);
1060 }
1061
1062 if (nsamplesZdc == 15)
1063 {
1064 t_raw15[iside][imod][0][0][isamp] = g0d0DataAcc(*zdcMod).at(isamp);
1065 t_raw15[iside][imod][0][1][isamp] = g0d1DataAcc(*zdcMod).at(isamp);
1066 t_raw15[iside][imod][1][0][isamp] = g1d0DataAcc(*zdcMod).at(isamp);
1067 t_raw15[iside][imod][1][1][isamp] = g1d1DataAcc(*zdcMod).at(isamp);
1068 }
1069
1070 if (nsamplesZdc == 24)
1071 {
1072 t_raw24[iside][imod][0][0][isamp] = g0dataAcc(*zdcMod).at(isamp);
1073 t_raw24[iside][imod][1][0][isamp] = g1dataAcc(*zdcMod).at(isamp);
1074 }
1075 if (nsamplesZdc == 32)
1076 {
1077 t_raw32[iside][imod][0][0][isamp] = g0dataAcc(*zdcMod).at(isamp);
1078 t_raw32[iside][imod][1][0][isamp] = g1dataAcc(*zdcMod).at(isamp);
1079 }
1080 if (nsamplesZdc == 40)
1081 {
1082 t_raw40[iside][imod][0][0][isamp] = g0dataAcc(*zdcMod).at(isamp);
1083 t_raw40[iside][imod][1][0][isamp] = g1dataAcc(*zdcMod).at(isamp);
1084 }
1085 }
1086 }
1087 }
1088 else if (zdcMod->zdcType() == 1 && nsamplesZdc == 24)
1089 {
1090 // this is the RPD
1091 if (enableRPD)
1092 {
1093 if (enableRPDAmp && !rpdErr)
1094 {
1095 t_RpdChannelBaseline[iside][zdcMod->zdcChannel()] = RPDChannelBaselineAcc(*zdcMod);
1096 std::vector<float> const &rpdChannelPileupExpFitParams = RPDChannelPileupExpFitParamsAcc(*zdcMod);
1097 std::copy(rpdChannelPileupExpFitParams.begin(), rpdChannelPileupExpFitParams.end(), t_RpdChannelPileupExpFitParams[iside][zdcMod->zdcChannel()]);
1098 std::vector<float> const &rpdChannelPileupExpFitParamErrs = RPDChannelPileupExpFitParamErrsAcc(*zdcMod);
1099 std::copy(rpdChannelPileupExpFitParamErrs.begin(), rpdChannelPileupExpFitParamErrs.end(), t_RpdChannelPileupExpFitParamErrs[iside][zdcMod->zdcChannel()]);
1100 std::vector<float> const &rpdChannelPileupStretchedExpFitParams = RPDChannelPileupStretchedExpFitParamsAcc(*zdcMod);
1101 std::copy(rpdChannelPileupStretchedExpFitParams.begin(), rpdChannelPileupStretchedExpFitParams.end(), t_RpdChannelPileupStretchedExpFitParams[iside][zdcMod->zdcChannel()]);
1102 std::vector<float> const &rpdChannelPileupStretchedExpFitParamErrs = RPDChannelPileupStretchedExpFitParamErrsAcc(*zdcMod);
1103 std::copy(rpdChannelPileupStretchedExpFitParamErrs.begin(), rpdChannelPileupStretchedExpFitParamErrs.end(), t_RpdChannelPileupStretchedExpFitParamErrs[iside][zdcMod->zdcChannel()]);
1104 t_RpdChannelPileupExpFitMSE[iside][zdcMod->zdcChannel()] = RPDChannelPileupExpFitMSEAcc(*zdcMod);
1105 t_RpdChannelPileupStretchedExpFitMSE[iside][zdcMod->zdcChannel()] = RPDChannelPileupStretchedExpFitMSEAcc(*zdcMod);
1106 t_RpdChannelAmplitude[iside][zdcMod->zdcChannel()] = RPDChannelAmplitudeAcc(*zdcMod);
1107 t_RpdChannelAmplitudeCalib[iside][zdcMod->zdcChannel()] = RPDChannelAmplitudeCalibAcc(*zdcMod);
1108 t_RpdChannelMaxADC[iside][zdcMod->zdcChannel()] = RPDChannelMaxADCAcc(*zdcMod);
1109 t_RpdChannelMaxADCCalib[iside][zdcMod->zdcChannel()] = RPDChannelMaxADCCalibAcc(*zdcMod);
1110 t_RpdChannelMaxSample[iside][zdcMod->zdcChannel()] = RPDChannelMaxSampleAcc(*zdcMod);
1111 t_RpdChannelStatus[iside][zdcMod->zdcChannel()] = RPDChannelStatusAcc(*zdcMod);
1112 t_RpdChannelPileupFrac[iside][zdcMod->zdcChannel()] = RPDChannelPileupFracAcc(*zdcMod);
1113 if(m_isMC){
1114 t_RpdModuleTruthNphotons[iside][zdcMod->zdcChannel()] = nPhotonsAcc(*zdcMod);
1115 }
1116 }
1118 {
1119 std::vector<uint16_t> const &rpdChannelRaw = g0dataAcc(*zdcMod);
1120 std::copy(rpdChannelRaw.begin(), rpdChannelRaw.end(), t_rpdRaw[iside][zdcMod->zdcChannel()]);
1121 }
1122 }
1123 }
1124 }
1125 }
1126 else
1127 {
1128 ANA_MSG_INFO("No ZdcModules" << auxSuffix << " when expected!");
1129 }
1130
1131 if (msgLvl (MSG::VERBOSE))
1132 {
1133 std::ostringstream message;
1134 message << "Dump zdc_ZdcModuleAmp: ";
1135 for (int iside = 0; iside < 2; iside++)
1136 {
1137 for (int imod = 0; imod < 4; imod++)
1138 {
1139 message << t_ZdcModuleAmp[iside][imod] << " ";
1140 }
1141 }
1142 }
1143}
1144
1146 /******************************************
1147 * Get the McEventCollection (input)
1148 ******************************************/
1149 SG::ReadHandle<McEventCollection> mcEventCollection (m_mcEventCollectionName, getContext());
1150 if (!mcEventCollection.isValid()){
1151 ANA_MSG_ERROR("Could not retrieve HepMC with key:" << m_mcEventCollectionName.key());
1152 return;
1153 }else{
1154 ANA_MSG_DEBUG("Retrieved HepMC with key: " << m_mcEventCollectionName.key());
1155 }
1156
1157 /******************************************
1158 * Clear and resize the output vectors
1159 ******************************************/
1160 t_ZdcTruthParticlePosx.clear();
1161 t_ZdcTruthParticlePosy.clear();
1162 t_ZdcTruthParticlePosz.clear();
1163 t_ZdcTruthParticleTime.clear();
1164 t_ZdcTruthParticlePx.clear();
1165 t_ZdcTruthParticlePy.clear();
1166 t_ZdcTruthParticlePz.clear();
1168 t_ZdcTruthParticlePid.clear();
1170
1171 /******************************************
1172 * Sort the particles into sides and add
1173 * them to the output vectors
1174 ******************************************/
1175 for (unsigned int cntr = 0; cntr < mcEventCollection->size(); ++cntr){
1176 const HepMC::GenEvent *genEvt = (*mcEventCollection)[cntr];
1177#ifdef HEPMC3
1178 for (const auto &vertex : genEvt->vertices()){
1179 for (const auto &particle : vertex->particles_in()){
1180#else
1181 for (const auto &vertex : genEvt->vertex_range()){
1182 for (auto ip = vertex->particles_in_const_begin();
1183 ip != vertex->particles_in_const_end();
1184 ++ip) {
1185 auto particle = *ip;
1186#endif
1187 t_ZdcTruthParticlePosx.push_back(vertex->position().x());
1188 t_ZdcTruthParticlePosy.push_back(vertex->position().y());
1189 t_ZdcTruthParticlePosz.push_back(vertex->position().z());
1190 t_ZdcTruthParticleTime.push_back(vertex->position().t());
1191 t_ZdcTruthParticlePx.push_back(particle->momentum().x());
1192 t_ZdcTruthParticlePy.push_back(particle->momentum().y());
1193 t_ZdcTruthParticlePz.push_back(particle->momentum().z());
1194 t_ZdcTruthParticleEnergy.push_back(particle->momentum().e());
1195 t_ZdcTruthParticlePid.push_back(particle->pdg_id());
1196 t_ZdcTruthParticleStatus.push_back(particle->status());
1197 } // end loop over particles
1198 }// end loop over vertices
1199 }// end loop over HepMC events
1200}
1201
1203{
1204 ANA_MSG_DEBUG ("Processing trigger");
1205
1206 bool passTrigger = false;
1207
1208 t_trigger = 0;
1209 t_trigger_TBP = 0;
1210
1211 for (int i = 0; i < 16; i++)
1212 {
1213 t_tav[i] = 0;
1214 t_tbp[i] = 0;
1215 }
1216
1217 if (m_trigDecision)
1218 {
1219 for (int i = 0; i < 16; i++)
1220 {
1221 t_tbp[i] = m_trigDecision->tbp().at(i);
1222 t_tav[i] = m_trigDecision->tav().at(i);
1223 ANA_MSG_DEBUG( "TD: " << i << " tbp: " << std::hex << t_tbp[i] << "\t" << t_tav[i] );
1224 }
1225 t_bunchGroup = m_trigDecision->bgCode();
1226 }
1227
1228 if (enableTrigger)
1229 {
1230
1231 int ic = 0;
1232 for (auto cg : m_chainGroups)
1233 {
1234
1235 if (zdcCalib)
1236 {
1237 std::string name = cg->getListOfTriggers().at(0);
1238 const unsigned int triggerbits = m_trigDecisionTool->isPassedBits(name);
1239 // deferred functionality
1240 //bool tbp = triggerbits&TrigDefs::L1_isPassedBeforePrescale;
1241 //bool tap = triggerbits&TrigDefs::L1_isPassedAfterPrescale;
1242 bool tav = triggerbits&TrigDefs::L1_isPassedAfterVeto;
1243 ANA_MSG_DEBUG("TD: checking trigger name=" << name<< " tav=" << tav);
1244 if (tav)
1245 {
1246 t_trigger += (1 << ic);
1247 t_decisions[ic] = true;
1248 t_prescales[ic] = cg->getPrescale();
1249 passTrigger = true;
1250 }
1251 else
1252 {
1253 t_decisions[ic] = 0;
1254 t_prescales[ic] = 0;
1255 }
1256 }
1257 else
1258 {
1259 if (cg->isPassed())
1260 {
1261 t_trigger += (1 << ic);
1262 t_decisions[ic] = true;
1263 t_prescales[ic] = cg->getPrescale();
1264 passTrigger = true;
1265 }
1266 else
1267 {
1268 t_decisions[ic] = 0;
1269 t_prescales[ic] = 0;
1270 }
1271 }
1272
1273 if (cg->isPassedBits()&TrigDefs::EF_passedRaw)
1274 {
1275 t_trigger_TBP += (1 << ic);
1276 }
1277
1278
1279 ic++;
1280 }
1281
1282 int irc = 0;
1283 for (auto cg : m_rerunChainGroups)
1284 {
1285 t_rerunDecisions[irc] = false;
1286 if (cg->isPassedBits()&TrigDefs::EF_passedRaw)
1287 {
1288 t_rerunDecisions[irc] = true;
1289 }
1290 irc++;
1291 }
1292
1293 }
1294
1295 return passTrigger;
1296}
1297
1299{
1300 ANA_MSG_DEBUG( "processing event info");
1301
1302 t_bcid = m_eventInfo->bcid();
1303 t_runNumber = m_eventInfo->runNumber();
1304 t_eventNumber = m_eventInfo->eventNumber();
1305 t_lumiBlock = m_eventInfo->lumiBlock();
1306 t_bunchGroup = -1;
1307 t_extendedLevel1ID = m_eventInfo->extendedLevel1ID();
1308 t_timeStamp = m_eventInfo->timeStamp();
1309 t_timeStampNSOffset = m_eventInfo->timeStampNSOffset();
1311 t_avgIntPerCrossing = m_eventInfo->averageInteractionsPerCrossing();
1312 t_actIntPerCrossing = m_eventInfo->actualInteractionsPerCrossing();
1315
1316 if ( !(m_eventCounter++ % 1000) || msgLvl(MSG::DEBUG))
1317 {
1318 ANA_MSG_INFO("Event# " << m_eventCounter << " Run " << m_eventInfo->runNumber() << " Event " << m_eventInfo->eventNumber() << " LB " << m_eventInfo->lumiBlock() );
1319 }
1320
1321}
1322
1324 // Check for new run number
1325 //
1327 //
1328 // Get access to the injector pulse steps for this run
1329 //
1331 if (!m_injMapRunToken.isValid()) {
1332 ANA_MSG_ERROR("Unable to obtain injector pulse steps for run " << t_runNumber);
1333 }
1334 else {
1335 unsigned int startLB = m_zdcInjPulserAmpMap->getFirstLumiBlock(m_injMapRunToken);
1336 unsigned int nsteps = m_zdcInjPulserAmpMap->getNumSteps(m_injMapRunToken);
1337 ANA_MSG_DEBUG("Successfully obtained injector pulse steps for run " << t_runNumber
1338 << ", first LB = " << startLB << ", number of steps = " << nsteps);
1339 }
1340
1341 // update the last run number to be the current run number
1343 }
1344
1346}
1347
1349{
1350 ANA_MSG_DEBUG("processInDet(): processing tracks & vertices!");
1351 t_ntrk = 0;
1352 t_nvx = 0;
1353 t_vxntrk = 0;
1354 t_vx_trk_index.clear();
1355 t_vxsumpt2 = 0;
1356 t_vxtype = 0;
1357 t_pvindex = -1;
1358 t_puvxntrk = 0;
1359 t_puvxsumpt = 0;
1361 t_vxnminbias = 0;
1362
1363 int i;
1364 for (i = 0; i < 3; i++) t_vx[i] = 0;
1365 for (i = 0; i < 6; i++) t_vxcov[i] = 0;
1366
1367 const xAOD::Vertex* primary_vertex = nullptr;
1368 size_t pv_index = -1;
1369 size_t vx_index = 0;
1370 float max_pileup_sumpT = 0.;
1371 int max_pileup_nTrack = 0;
1372 float max_pileup_z = 0;
1373 int nStrongPileup = 0;
1374
1375 t_nvtx = 0;
1376 t_vtx_type.clear();
1377 t_vtx_x.clear();
1378 t_vtx_y.clear();
1379 t_vtx_z.clear();
1380 t_vtx_ntrk_all.clear();
1381 t_vtx_sumpt2_all.clear();
1382 t_vtx_ntrk.clear();
1383 t_vtx_sumpt2.clear();
1384 t_vtx_trk_index.clear();
1385
1387 {
1388 ANA_MSG_DEBUG("processInDet: processing vertices");
1389
1390 t_nvx = m_primaryVertices->size();
1391
1392 static const SG::ConstAccessor<float> sumPt2Acc("sumPt2");
1393
1394 // start of new vertex representation
1395 t_nvtx = m_primaryVertices->size();
1396 for (const auto vertex : *m_primaryVertices)
1397 {
1398 float vtx_sumpt2 = 0;
1399 int vtx_ntrk = 0;
1400
1401 t_vtx_type.push_back(vertex->vertexType());
1402 t_vtx_x.push_back(0);
1403 t_vtx_y.push_back(0);
1404 t_vtx_z.push_back(vertex->z());
1405
1406 t_vtx_ntrk.push_back(vtx_ntrk);
1407 t_vtx_sumpt2.push_back(vtx_sumpt2 / 1e6);
1408 t_vtx_ntrk_all.push_back(vertex->nTrackParticles());
1409
1410 if (sumPt2Acc.isAvailable(*vertex))
1411 t_vtx_sumpt2_all.push_back(sumPt2Acc(*vertex));
1412 else
1413 t_vtx_sumpt2_all.push_back(-1);
1414
1415 std::vector<int16_t> trk_index;
1416 if ( m_trackParticles && vertex->nTrackParticles() <= trackLimit )
1417 {
1418 const std::vector< ElementLink< xAOD::TrackParticleContainer > >& vxTrackParticles = vertex->trackParticleLinks();
1419 for (size_t itrk = 0; itrk < vxTrackParticles.size(); itrk++)
1420 {
1421 ElementLink< xAOD::TrackParticleContainer > trkLink = vxTrackParticles.at(itrk);
1422 trk_index.push_back(trkLink.index());
1423 }
1424 }
1425 t_vtx_trk_index.push_back(trk_index);
1426
1427 // end of new vertex representation
1428
1429 if (vertex->vertexType() == xAOD::VxType::PriVtx)
1430 {
1431 primary_vertex = vertex;
1432 pv_index = vx_index;
1433 }
1434 if (vertex->vertexType() == xAOD::VxType::PileUp)
1435 {
1436 float pileup_sumpT = 0;
1437 int pileup_nTrack = 0;
1438 for (size_t itr = 0; itr < vertex->nTrackParticles(); itr++)
1439 {
1440 int track_quality = trackQuality(vertex->trackParticle(itr), vertex);
1441 if (track_quality != -1 && (track_quality & 128) != 0)
1442 {
1443 pileup_nTrack++;
1444 pileup_sumpT += vertex->trackParticle(itr)->pt();
1445 }
1446 }
1447 if (pileup_sumpT > max_pileup_sumpT)
1448 {
1449 max_pileup_sumpT = pileup_sumpT;
1450 max_pileup_nTrack = pileup_nTrack;
1451 max_pileup_z = vertex->z();
1452 }
1453 if (pileup_sumpT > 5e3 || pileup_nTrack > 5) nStrongPileup++;
1454 }
1455 vx_index++;
1456 }
1457 }
1458
1459 t_nstrong = nStrongPileup;
1460
1461 if (primary_vertex != nullptr)
1462 {
1463 t_vx[0] = primary_vertex->x();
1464 t_vx[1] = primary_vertex->y();
1465 t_vx[2] = primary_vertex->z();
1466 /*
1467 const std::vector<float>& cov = primary_vertex->covariance();
1468 */
1469 //for (size_t i=0;i<cov.size();i++)
1470 for (size_t i = 0; i < 6; i++)
1471 {
1472 //t_vxcov[i] = cov.at(i);
1473 t_vxcov[i] = 0;
1474 }
1475 t_vxntrk = primary_vertex->nTrackParticles();
1476 static const SG::ConstAccessor<float> sumPt2Acc("sumPt2");
1477 if (sumPt2Acc.isAvailable(*primary_vertex))
1478 t_vxsumpt2 = sumPt2Acc(*primary_vertex);
1479 else
1480 t_vxsumpt2 = 0;
1481
1482 t_vxtype = primary_vertex->vertexType();
1483 t_pvindex = pv_index;
1484 t_puvxz = max_pileup_z;
1485 t_puvxsumpt = max_pileup_sumpT;
1486 t_puvxntrk = max_pileup_nTrack;
1487
1488 const std::vector< ElementLink< xAOD::TrackParticleContainer > >& vxTrackParticles = primary_vertex->trackParticleLinks();
1489
1490 for (size_t itrk = 0; itrk < vxTrackParticles.size(); itrk++)
1491 {
1492 ElementLink< xAOD::TrackParticleContainer > trkLink = vxTrackParticles.at(itrk);
1493 if (!trkLink.isValid()) continue;
1494 if (m_trackParticles)
1495 {
1496 if (m_trackParticles->size() <= trackLimit)
1497 t_vx_trk_index.push_back(trkLink.index());
1498 }
1499 }
1500
1501 }
1502
1503
1504 if (m_trackParticles)
1505 {
1506 ANA_MSG_DEBUG("processInDet: processing trackss");
1507
1508 t_trk_pt.clear();
1509 t_trk_eta.clear();
1510 t_trk_phi.clear();
1511 t_trk_e.clear();
1512 t_trk_index.clear();
1513 t_trk_theta.clear();
1514 t_trk_charge.clear();
1515 t_trk_d0.clear();
1516 t_trk_z0.clear();
1517 t_trk_vz.clear();
1518 t_trk_vtxz.clear();
1519 t_trk_quality.clear();
1520 t_trk_nPixHits.clear();
1521 t_trk_nSctHits.clear();
1522 t_trk_nPixDead.clear();
1523 t_trk_nSctDead.clear();
1524 t_trk_nPixHoles.clear();
1525 t_trk_nSctHoles.clear();
1526 t_trk_nTrtHits.clear();
1527 t_trk_nTrtOutliers.clear();
1528 t_trk_inPixHits.clear();
1529 t_trk_exPixHits.clear();
1530 t_trk_ninPixHits.clear();
1531 t_trk_nexPixHits.clear();
1532 t_trk_pixeldEdx.clear();
1533
1534 t_ntrk = m_trackParticles->size();
1535
1536 if ( !enableTracks ) return;
1537
1538 if ( t_ntrk <= trackLimit ) // dump all tracks
1539 {
1540 int trk_index = 0;
1541 for (const auto track : *m_trackParticles)
1542 {
1543 writeTrack(track, primary_vertex, trk_index++);
1544 }
1545 }
1546 else // write small vertices
1547 {
1548 for (const auto vertex : *m_primaryVertices)
1549 {
1550 if (vertex->nTrackParticles() <= trackLimit )
1551 {
1552 const std::vector< ElementLink< xAOD::TrackParticleContainer > >& vxTrackParticles = vertex->trackParticleLinks();
1553 for (size_t itrk = 0; itrk < vxTrackParticles.size(); itrk++)
1554 {
1555 ElementLink< xAOD::TrackParticleContainer > trkLink = vxTrackParticles.at(itrk);
1556 writeTrack(*trkLink, vertex, trkLink.index());
1557 }
1558 }
1559 }
1560 }
1561 }
1562
1563 return;
1564}
1565
1566
1568{
1569
1570 if (!track) return -1;
1571
1572 bool pass_looseprimary = false;
1573 if (m_selTool->accept(*track,vertex))
1574 {
1575 pass_looseprimary = true;
1576 }
1577
1578 int quality = 0;
1579 if (pass_looseprimary) quality += 1;
1580
1581 return quality;
1582
1583}
1584
1585
1586
1587void ZdcNtuple::writeTrack(const xAOD::TrackParticle* track, const xAOD::Vertex* vertex, int trk_index)
1588{
1589 t_trk_pt.push_back(track->pt());
1590 t_trk_eta.push_back(track->eta());
1591 t_trk_phi.push_back(track->phi());
1592 t_trk_e.push_back(track->e());
1593 t_trk_index.push_back(trk_index);
1594 t_trk_theta.push_back(track->theta());
1595 t_trk_charge.push_back(track->charge());
1596 t_trk_d0.push_back(track->d0());
1597 t_trk_z0.push_back(track->z0());
1598 t_trk_vz.push_back(track->vz());
1599
1600 float vtxz = -999.;
1601 t_trk_vtxz.push_back(vtxz);
1602
1603 static const SG::ConstAccessor<uint8_t> numberOfInnermostPixelLayerHitsAcc("numberOfInnermostPixelLayerHits");
1604 static const SG::ConstAccessor<uint8_t> expectInnermostPixelLayerHitAcc("expectInnermostPixelLayerHit");
1605 static const SG::ConstAccessor<uint8_t> numberOfNextToInnermostPixelLayerHitsAcc("numberOfNextToInnermostPixelLayerHits");
1606 static const SG::ConstAccessor<uint8_t> expectNextToInnermostPixelLayerHitAcc("expectNextToInnermostPixelLayerHit");
1607 static const SG::ConstAccessor<uint8_t> numberOfSCTHitsAcc("numberOfSCTHits");
1608 static const SG::ConstAccessor<uint8_t> numberOfPixelHitsAcc("numberOfPixelHits");
1609 static const SG::ConstAccessor<uint8_t> numberOfSCTDeadSensorsAcc("numberOfSCTDeadSensors");
1610 static const SG::ConstAccessor<uint8_t> numberOfPixelDeadSensorsAcc("numberOfPixelDeadSensors");
1611 static const SG::ConstAccessor<uint8_t> numberOfSCTHolesAcc("numberOfSCTHoles");
1612 static const SG::ConstAccessor<uint8_t> numberOfPixelHolesAcc("numberOfPixelHoles");
1613 static const SG::ConstAccessor<uint8_t> numberOfTRTHitsAcc("numberOfTRTHits");
1614 static const SG::ConstAccessor<uint8_t> numberOfTRTOutliersAcc("numberOfTRTOutliers");
1615
1616 t_trk_quality.push_back(trackQuality(track, vertex));
1617 t_trk_inPixHits.push_back(numberOfInnermostPixelLayerHitsAcc(*track));
1618 t_trk_exPixHits.push_back(expectInnermostPixelLayerHitAcc(*track));
1619 t_trk_ninPixHits.push_back(numberOfNextToInnermostPixelLayerHitsAcc(*track));
1620 t_trk_nexPixHits.push_back(expectNextToInnermostPixelLayerHitAcc(*track));
1621 t_trk_nSctHits.push_back(numberOfSCTHitsAcc(*track));
1622 t_trk_nPixHits.push_back(numberOfPixelHitsAcc(*track));
1623 t_trk_nSctDead.push_back(numberOfSCTDeadSensorsAcc(*track));
1624 t_trk_nPixDead.push_back(numberOfPixelDeadSensorsAcc(*track));
1625 t_trk_nSctHoles.push_back(numberOfSCTHolesAcc(*track));
1626 t_trk_nPixHoles.push_back(numberOfPixelHolesAcc(*track));
1627 t_trk_nTrtHits.push_back(numberOfTRTHitsAcc(*track));
1628 t_trk_nTrtOutliers.push_back(numberOfTRTOutliersAcc(*track));
1629
1630 float pixeldEdx = 0;
1631 track->summaryValue(pixeldEdx, xAOD::SummaryType::pixeldEdx);
1632 t_trk_pixeldEdx.push_back(pixeldEdx);
1633}
1634
1635
1637{
1638 ANA_MSG_DEBUG("processFCal: processing FCal");
1639
1640 t_fcalEt = 0.;
1641 t_fcalEtA = 0.;
1642 t_fcalEtC = 0.;
1643 t_fcalEtA_TT = 0.;
1644 t_fcalEtC_TT = 0.;
1645
1646 if (m_caloSums)
1647 {
1648 static const SG::ConstAccessor<std::string> SummaryAcc("Summary");
1649 for (const auto calosum : *m_caloSums)
1650 {
1651 const std::string name = SummaryAcc(*calosum);
1652 if (name == "FCal")
1653 {
1654 t_fcalEt = calosum->et();
1655 ANA_MSG_DEBUG("processFCal: fcalEt = " << t_fcalEt);
1656 }
1657
1658 if (name == "All")
1659 {
1660 t_totalEt = calosum->et();
1661 ANA_MSG_DEBUG("processFCal: totalEt = " << t_totalEt);
1662 }
1663 }
1664 }
1665
1666 t_fcalEtA = 0;
1667 t_fcalEtC = 0;
1668 t_totalEt24 = 0;
1669
1670 if (m_eventShapes)
1671 {
1672 for (const auto eventShape : *m_eventShapes)
1673 {
1674 int layer = eventShape->layer();
1675 float eta = eventShape->etaMin();
1676 float et = eventShape->et();
1677 if (layer == 21 || layer == 22 || layer == 23)
1678 {
1679 if (eta > 0) t_fcalEtA += et;
1680 if (eta < 0) t_fcalEtC += et;
1681 }
1682
1683 if (TMath::Abs(eta) < 2.4)
1684 {
1685 t_totalEt24 += et;
1686 }
1687 }
1688 }
1689
1690 t_L1ET = 0;
1691 t_L1ET24 = 0;
1692
1694 {
1695 t_L1ET = m_lvl1EnergySumRoI->energyT();
1696 //t_L1ET24 = m_lvl1EnergySumRoI->energyTRestricted(); // TBD when limited eta ET available
1697 }
1698
1699 return;
1700}
1701
1703{
1704
1705 float eta_min = 5;
1706 float eta_max = -5;
1707
1708 if (!m_caloClusters) return;
1709 for (const auto cl : *m_caloClusters)
1710 {
1711
1712 if (cl->pt() < m_gapPtMin) continue;
1713
1714 int etabin = h_TCSigCut->GetXaxis()->FindBin(cl->eta());
1715 if (etabin < 1 || etabin > h_TCSigCut->GetNbinsX()) continue;
1716 float sig_cut = h_TCSigCut->GetBinContent(etabin);
1717 float sig = cl->getMomentValue(xAOD::CaloCluster::CELL_SIGNIFICANCE);
1718 int cl_cell_sig_samp = static_cast<int>(cl->getMomentValue(xAOD::CaloCluster::CELL_SIG_SAMPLING));
1719
1720 // ANA_MSG_VERBOSE ("gapclus: etabin " << etabin << " sig_cut=" << sig_cut << " sig=" << sig << " samp=" << cl_cell_sig_samp);
1721
1722 if (sig < sig_cut) continue;
1723
1724 if (cl_cell_sig_samp >= CaloSampling::TileBar0 && cl_cell_sig_samp <= CaloSampling::TileExt2) continue;
1725
1726 if (cl->eta() < eta_min) eta_min = cl->eta();
1727 if (cl->eta() > eta_max) eta_max = cl->eta();
1728
1729 }
1730
1731 t_edgeGapA = 4.9 - eta_max;
1732 t_edgeGapC = eta_min + 4.9;
1733 ANA_MSG_DEBUG("processGaps(): egA " << t_edgeGapA << " , egC " << t_edgeGapC);
1734
1735}
1736
1738{
1739 ANA_MSG_DEBUG("processMBTS: trying to process!");
1740 t_mbts_countA = 0;
1741 t_mbts_countC = 0;
1744 t_mbts_timeA = 0.;
1745 t_mbts_timeC = 0.;
1746 t_mbts_timeDiff = 0.;
1747
1748 if (m_mbtsInfo->size() > 0)
1749 {
1750 t_mbts_countA = m_mbtsInfo->at(0)->countA();
1751 t_mbts_countC = m_mbtsInfo->at(0)->countC();
1752 t_mbts_timeA = m_mbtsInfo->at(0)->timeA();
1753 t_mbts_timeC = m_mbtsInfo->at(0)->timeC();
1754 t_mbts_timeDiff = m_mbtsInfo->at(0)->timeDiff();
1755 }
1756 else
1757 {
1758 ANA_MSG_INFO("processMBTS: Warning: MBTS info empty!");
1759 }
1760
1761 for (int iside = 0; iside < 2; iside++)
1762 {
1763 for (int iin = 0; iin < 8; iin++)
1764 {
1765 t_mbts_in_e[iside][iin] = 0.;
1766 t_mbts_in_t[iside][iin] = 0.;
1767 t_T2mbts_in_e[iside][iin] = 0.;
1768 t_T2mbts_in_t[iside][iin] = 0.;
1769 }
1770 for (int iout = 0; iout < 4; iout++)
1771 {
1772 t_mbts_out_e[iside][iout] = 0.;
1773 t_mbts_out_t[iside][iout] = 0.;
1774 t_T2mbts_out_e[iside][iout] = 0.;
1775 t_T2mbts_out_t[iside][iout] = 0.;
1776 }
1777 }
1778
1779 ANA_MSG_DEBUG ("filling MBTS");
1780
1781 if (m_mbtsModules == 0)
1782 {
1783 ANA_MSG_INFO("processMBTS: no MBTS container?");
1784 return;
1785 }
1786
1787 for (const auto mbtsMod : *m_mbtsModules)
1788 {
1789 int iside = 1;
1790 if (mbtsMod->type() < 0) iside = 0.;
1791 float phibin = 0.;
1792 int iphibin = -1;
1793 if (mbtsMod->eta() > 3)
1794 {
1795 phibin = mbtsMod->phi() / (2 * TMath::Pi() / 8.) - 0.4;
1796 iphibin = static_cast<int>(phibin);
1797 if (iphibin < 0 || iphibin > 7)
1798 {
1799 ANA_MSG_INFO("processMBTS: MBTS has bad phi bin");
1800 continue;
1801 }
1802 t_mbts_in_e[iside][iphibin] = mbtsMod->e();
1803 t_mbts_in_t[iside][iphibin] = mbtsMod->time();
1804 }
1805 else
1806 {
1807 phibin = mbtsMod->phi() / (2 * TMath::Pi() / 4.) - 0.24;
1808 iphibin = static_cast<int>(phibin);
1809 if (iphibin < 0 || iphibin > 3)
1810 {
1811 ANA_MSG_INFO("processMBTS: MBTS has bad phi bin");
1812 continue;
1813 }
1814 t_mbts_out_e[iside][iphibin] = mbtsMod->e();
1815 t_mbts_out_t[iside][iphibin] = mbtsMod->time();
1816 }
1817 }
1818
1819 if (!m_trigT2MbtsBits) return;
1820
1821 for (const auto mbtsBits : *m_trigT2MbtsBits)
1822 {
1823 const std::vector<float>& energies = mbtsBits->triggerEnergies();
1824 const std::vector<float>& times = mbtsBits->triggerTimes();
1825 for (int imbts = 0; imbts < 32; imbts++)
1826 {
1827 int side = imbts / 16;
1828 int ring = (imbts - 16 * side) / 8;
1829 bool isInner = (ring == 0);
1830 int index = (imbts - 16 * side - ring * 8);
1831 if (!isInner)
1832 {
1833 if ((index % 2) != 0) continue; // skip odd out ring
1834 index /= 2;
1835 }
1836 int iside = (side == 0) ? 1 : 0; // code maps side 1 into first 16 bits and side -1 into second set
1837
1838 ANA_MSG_VERBOSE ("imbts=" << imbts << " isInner=" << isInner << " iside=" << iside << " index=" << index << " e=" << energies.at(imbts) << " t=" << times.at(imbts));
1839 if (iside < 2 and index < 8){ //indices in range?
1840 if (isInner)
1841 {
1842 t_T2mbts_in_e[iside][index] = energies.at(imbts);
1843 t_T2mbts_in_t[iside][index] = times.at(imbts);
1844 if (TMath::Abs(times.at(imbts)) < 12.0 && energies.at(imbts) > 40 / 222.)
1845 {
1846 if (iside == 0) t_T2mbts_countCin++;
1847 if (iside == 1) t_T2mbts_countAin++;
1848 }
1849 }
1850 else
1851 {
1852 t_T2mbts_out_e[iside][index] = energies.at(imbts);
1853 t_T2mbts_out_t[iside][index] = times.at(imbts);
1854 }
1855 } //indices check
1856 }
1857 }
1858
1859 return;
1860}
1861
1863{
1864 //t_nclus = 0;
1865
1866 t_cc_pt.clear();
1867 t_cc_eta.clear();
1868 t_cc_phi.clear();
1869 t_cc_e.clear();
1870 t_cc_raw_m.clear();
1871 t_cc_raw_eta.clear();
1872 t_cc_raw_phi.clear();
1873 t_cc_raw_e.clear();
1874 t_cc_raw_samp.clear();
1875 t_cc_layer.clear();
1876 t_cc_sig.clear();
1877
1878 t_nclus = m_caloClusters->size();
1879
1880 t_clusEt = 0;
1881 t_clusEtMax = -999;
1882 t_clusetaMax = 0;
1883 t_clusphiMax = 0;
1884
1885 for (const auto cluster : *m_caloClusters)
1886 {
1887 t_cc_pt.push_back(cluster->pt());
1888 t_cc_eta.push_back(cluster->eta());
1889 t_cc_phi.push_back(cluster->phi());
1890 t_cc_e.push_back(cluster->e());
1891 t_cc_raw_m.push_back(cluster->rawM());
1892 t_cc_raw_eta.push_back(cluster->rawEta());
1893 t_cc_raw_phi.push_back(cluster->rawPhi());
1894 t_cc_raw_e.push_back(cluster->rawE());
1895
1896 std::vector<float> energies;
1897
1898 for (size_t s = CaloSampling::PreSamplerB; s < CaloSampling::Unknown; s++ )
1899 {
1900 bool hasSample = cluster->hasSampling( (xAOD::CaloCluster::CaloSample) s );
1901 float e = 0;
1902 if (hasSample)
1903 {
1904 e = cluster->eSample( (xAOD::CaloCluster::CaloSample) s);
1905 }
1906 energies.push_back(e);
1907 }
1908 t_cc_raw_samp.push_back(energies);
1909
1910 float et = cluster->e() / TMath::CosH(cluster->eta());
1911 t_clusEt += et;
1912 if (et > t_clusEtMax)
1913 {
1914 t_clusEtMax = et;
1915 t_clusetaMax = cluster->eta();
1916 t_clusphiMax = cluster->phi();
1917 }
1918
1919 double cell_sig = 0;
1920 if (!cluster->retrieveMoment(xAOD::CaloCluster::CELL_SIGNIFICANCE, cell_sig)) {ANA_MSG_DEBUG("processClusters() : No CELL_SIGNIFICANCE!");}
1921 t_cc_sig.push_back(cell_sig);
1922 double cell_layer = 0;
1923 if (!cluster->retrieveMoment(xAOD::CaloCluster::CELL_SIG_SAMPLING, cell_layer)) {ANA_MSG_DEBUG("processClusters() : No CELL_SIG_SAMPLING!");}
1924 t_cc_layer.push_back(static_cast<int>(cell_layer));
1925 //t_nclus++;
1926 }
1927
1928 if ( (!enableClusters) || (t_ntrk >= trackLimit) ) // if disabled or if too many tracks
1929 {
1930 t_cc_pt.clear();
1931 t_cc_eta.clear();
1932 t_cc_phi.clear();
1933 t_cc_e.clear();
1934 t_cc_layer.clear();
1935 t_cc_sig.clear();
1936 }
1937 else
1938 {
1939 ANA_MSG_DEBUG("processClusters(): keeping clusters");
1940 }
1941 return;
1942}
1943
1945
1946 proton_pt.clear();
1947 proton_eta.clear();
1948 proton_phi.clear();
1949 proton_e.clear();
1950 proton_side.clear();
1951 proton_eLoss.clear();
1952 proton_t.clear();
1953
1954 proton_track_stationID.clear();
1955 proton_track_nClusters.clear();
1956 proton_track_xLocal.clear();
1957 proton_track_yLocal.clear();
1958 proton_track_zLocal.clear();
1959 proton_track_xSlope.clear();
1960 proton_track_ySlope.clear();
1961
1962 proton_track_stationID.resize(m_afpProtons->size(), std::vector<int>(2));
1963 proton_track_nClusters.resize(m_afpProtons->size(), std::vector<int>(2));
1964 proton_track_xLocal.resize(m_afpProtons->size(), std::vector<float>(2));
1965 proton_track_yLocal.resize(m_afpProtons->size(), std::vector<float>(2));
1966 proton_track_zLocal.resize(m_afpProtons->size(), std::vector<float>(2));
1967 proton_track_xSlope.resize(m_afpProtons->size(), std::vector<float>(2));
1968 proton_track_ySlope.resize(m_afpProtons->size(), std::vector<float>(2));
1969
1970 nProtons = 0;
1971
1972 for(const auto * proton: *m_afpProtons){
1973
1974 proton_pt.push_back(proton->pt());
1975 proton_eta.push_back(proton->eta());
1976 proton_phi.push_back(proton->phi());
1977 proton_e.push_back(proton->e());
1978 proton_side.push_back(proton->side());
1979
1980 proton_eLoss.push_back((6800.-proton->e())/6800.);
1981 p_scat.SetPtEtaPhiE(proton->pt(), proton->eta(), proton->phi(), proton->e());
1982 (signbit(proton->eta())) ? p_beam.SetPxPyPzE(0.0, 0.0, -6800.0, 6800.0) : p_beam.SetPxPyPzE(0.0, 0.0, 6800.0,\
1983 6800.0);
1984
1985 proton_t.push_back( (p_beam - p_scat)*(p_beam - p_scat));
1986
1987 for(int i=0; i< int(proton->nTracks()); i++){
1988
1989 proton_track_stationID.at(nProtons).at(i) = proton->track(i)->stationID();
1990 proton_track_nClusters.at(nProtons).at(i) = proton->track(i)->nClusters();
1991 proton_track_xLocal.at(nProtons).at(i) = proton->track(i)->xLocal();
1992 proton_track_yLocal.at(nProtons).at(i) = proton->track(i)->yLocal();
1993 proton_track_zLocal.at(nProtons).at(i) = proton->track(i)->zLocal();
1994 proton_track_xSlope.at(nProtons).at(i) = proton->track(i)->xSlope();
1995 proton_track_ySlope.at(nProtons).at(i) = proton->track(i)->ySlope();
1996
1997 }
1998
1999 nProtons++;
2000 }
2001
2002 return;
2003}
2004
2006{
2007 uint32_t passbits = 0;
2008
2009 if (!m_isMC)
2010 {
2011 if (useGRL)
2012 {
2013 if (!m_grl->passRunLB(*m_eventInfo)) {
2014 passbits += 1; // UPC GRL
2015 }
2016 }
2017
2018 /*
2019 if(!m_grl_mb->passRunLB(*m_eventInfo)){
2020 passbits += 4; // MB GRL
2021 }
2022 */
2023
2027 || (m_eventInfo->isEventFlagBitSet(xAOD::EventInfo::Core, 18) ) )
2028 {
2029 passbits += 2;
2030 } // end if event flags check
2031 } // end if the event is data
2032
2033 return passbits;
2034}
2035
2037{
2038 if (!enableTrigger) return;
2039
2040 m_outputTree = tree( "zdcTree" );
2041 ANA_MSG_INFO("setupTriggerHistos(): Setting up trigger histos and ntuple = " << m_outputTree);
2042
2043 std::vector<std::string> triggers;
2044 std::vector<std::string> rerunTriggers;
2045 bool zdc_triggers = true;
2046
2047 // ZDC triggers
2048 if (zdc_triggers)
2049 {
2050 if (zdcCalib) // lists for calibration data
2051 {
2052 if (lhcf2022)
2053 {
2054 triggers.push_back("L1_LHCF");
2055 triggers.push_back("L1_ZDC_OR");
2056 }
2057
2058 if (pbpb2023)
2059 {
2060 triggers.push_back("L1_ZDC_OR");
2061 triggers.push_back("L1_ZDC_A");
2062 triggers.push_back("L1_ZDC_C");
2063 triggers.push_back("L1_ZDC_A_C");
2064 triggers.push_back("L1_ZDC_OR_EMPTY");
2065 triggers.push_back("L1_ZDC_A_EMPTY");
2066 triggers.push_back("L1_ZDC_C_EMPTY");
2067 triggers.push_back("L1_ZDC_A_C_EMPTY");
2068 triggers.push_back("L1_ZDC_OR_UNPAIRED_NONISO");
2069 triggers.push_back("L1_ZDC_A_UNPAIRED_NONISO");
2070 triggers.push_back("L1_ZDC_C_UNPAIRED_NONISO");
2071 triggers.push_back("L1_ZDC_A_C_UNPAIRED_NONISO");
2072 }
2073 }
2074 else // lists for physics data
2075 {
2076 if (lhcf2022)
2077 {
2078 triggers.push_back("HLT_noalg_L1LHCF");
2079 }
2080 if (lhcf2022afp)
2081 {
2082 triggers.push_back("HLT_noalg_AFPPEB_L1AFP_A");
2083 triggers.push_back("HLT_noalg_AFPPEB_L1AFP_C");
2084 }
2085 if (lhcf2022zdc)
2086 {
2087 triggers.push_back("HLT_noalg_ZDCPEB_L1ZDC_OR");
2088 triggers.push_back("HLT_noalg_ZDCPEB_L1LHCF");
2089 triggers.push_back("HLT_noalg_L1ZDC_OR");
2090 triggers.push_back("HLT_noalg_L1ZDC_XOR_E2");
2091 triggers.push_back("HLT_noalg_L1ZDC_XOR_E1_E3");
2092 triggers.push_back("HLT_noalg_L1ZDC_A_AND_C");
2093 triggers.push_back("HLT_mb_sptrk_L1ZDC_OR");
2094 triggers.push_back("HLT_mb_sptrk_L1ZDC_XOR_E2");
2095 triggers.push_back("HLT_mb_sptrk_L1ZDC_XOR_E1_E3");
2096 triggers.push_back("HLT_mb_sptrk_L1ZDC_A_AND_C");
2097 triggers.push_back("HLT_mb_sp100_trk30_hmt_L1ZDC_XOR_E2");
2098 triggers.push_back("HLT_mb_sp100_trk30_hmt_L1ZDC_XOR_E1_E3");
2099 triggers.push_back("HLT_mb_sp100_trk30_hmt_L1ZDC_A_AND_C");
2100 }
2101 if (oo2025) {
2102 triggers = {
2103 "HLT_mb_sptrk_L1TRT_ZDC_A", "HLT_mb_sptrk_L1TRT_ZDC_C", "HLT_mb_sptrk_L1TRT_ZDC_A_C",
2104 "HLT_mb_sptrk_L1TRT_ZDC_OR", "HLT_mb_sptrk_L1TRT_ZDC_LOR",
2105 "HLT_mb_sptrk_L1ZDC_A", "HLT_mb_sptrk_L1ZDC_C", "HLT_mb_sptrk_L1ZDC_A_C",
2106 "HLT_mb_sptrk_L1ZDC_LOR", "HLT_mb_sptrk_L1ZDC_OR",
2107 "HLT_mb_sptrk_L1ZDC_XN", "HLT_mb_sptrk_L1ZDC_YN", "HLT_mb_sptrk_L1ZDC_ZN",
2108 "HLT_mb_sptrk_L1ZDC_XNXN", "HLT_mb_sptrk_L1ZDC_XNYN", "HLT_mb_sptrk_L1ZDC_XNZN",
2109 "HLT_mb_sptrk_L1ZDC_XN_XOR", "HLT_mb_sptrk_L1ZDC_YNYN", "HLT_mb_sptrk_L1ZDC_YN_XOR",
2110 "HLT_mb_sptrk_L1ZDC_ZN_XOR",
2111 "HLT_noalg_L1TRT_ZDC_A", "HLT_noalg_L1TRT_ZDC_C", "HLT_noalg_L1TRT_ZDC_A_C",
2112 "HLT_noalg_L1TRT_ZDC_OR", "HLT_noalg_L1TRT_ZDC_LOR",
2113 "HLT_noalg_L1TRT_ZDC_YN", "HLT_noalg_L1TRT_ZDC_ZN",
2114 "HLT_noalg_L1TRT_ZDC_XNXN", "HLT_noalg_L1TRT_ZDC_XNYN", "HLT_noalg_L1TRT_ZDC_XNZN",
2115 "HLT_noalg_L1TRT_ZDC_XN_XOR", "HLT_noalg_L1TRT_ZDC_YNYN", "HLT_noalg_L1TRT_ZDC_YN_XOR",
2116 "HLT_noalg_L1TRT_ZDC_ZN_XOR",
2117 "HLT_noalg_L1ZDC_A", "HLT_noalg_L1ZDC_C", "HLT_noalg_L1ZDC_A_C",
2118 "HLT_noalg_L1ZDC_OR", "HLT_noalg_L1ZDC_LOR",
2119 "HLT_noalg_L1ZDC_YN", "HLT_noalg_L1ZDC_ZN",
2120 "HLT_noalg_L1ZDC_XNXN", "HLT_noalg_L1ZDC_XNYN", "HLT_noalg_L1ZDC_XNZN",
2121 "HLT_noalg_L1ZDC_XN_XOR", "HLT_noalg_L1ZDC_YNYN", "HLT_noalg_L1ZDC_YN_XOR",
2122 "HLT_noalg_L1ZDC_ZN_XOR"
2123 };
2124 }
2125 }
2126 }
2127
2128 //char name[50];
2129 ANA_MSG_INFO("Adding trigger branches!");
2130
2131 int ic = 0;
2132 for (auto &trig : triggers)
2133 {
2134 const Trig::ChainGroup* cg = m_trigDecisionTool->getChainGroup(trig);
2135 if (cg->getListOfTriggers().size())
2136 {
2137 ANA_MSG_INFO("setupTriggerHistos(): Trigger found = " << trig.c_str() << " bit " << ic);
2138 }
2139 else
2140 {
2141 ANA_MSG_INFO("setupTriggerHistos(): Trigger NOT found = " << trig.c_str() << " bit " << ic);
2142 }
2143 m_chainGroups.push_back(cg);
2144 // force all triggers to show up in tree
2145 TString bname(trig.c_str());
2146 m_outputTree->Branch(bname, &(t_decisions[ic]), bname + "/O");
2147 m_outputTree->Branch("ps_" + bname, &(t_prescales[ic]), "ps_" + bname + "/F");
2148 ic++;
2149 }
2150
2151 ANA_MSG_INFO( "triggers = " << triggers.size() << " chains = " << m_chainGroups.size() );
2152
2153 int irc = 0;
2154 ANA_MSG_INFO("Adding rerun trigger branches!");
2155 for (auto &trig : rerunTriggers)
2156 {
2157 const Trig::ChainGroup* cg = m_trigDecisionTool->getChainGroup(trig);
2158 m_rerunChainGroups.push_back(cg);
2159 if (cg->getListOfTriggers().size())
2160 {
2161 ANA_MSG_INFO("setupTriggerHistos(): Rerun trigger found = " << trig.c_str() << " bit " << irc);
2162 }
2163 else
2164 {
2165 ANA_MSG_INFO("setupTriggerHistos(): Rerun trigger NOT found = " << trig.c_str() << " bit " << irc);
2166 }
2167 // force all rerun triggers to show up in tree
2168 TString bname(trig.c_str());
2169 m_outputTree->Branch(bname, &(t_rerunDecisions[irc]), bname + "/O");
2170 irc++;
2171 }
2172
2173 // trigger matching flags for electrons and muons
2174
2175 m_setupTrigHist = true;
2176
2177 ANA_MSG_INFO("setupTriggerHistos(): Finished setting up trigger");
2178
2179}
2180
2181// from TrigMuonMatching
2182double ZdcNtuple::dR(const double eta1, const double phi1, const double eta2, const double phi2)
2183{
2184 double deta = std::abs(eta1 - eta2);
2185 double dphi = std::abs(phi1 - phi2) < TMath::Pi() ? std::abs(phi1 - phi2) : 2 * TMath::Pi() - std::abs(phi1 - phi2);
2186 return std::sqrt(deta * deta + dphi * dphi);
2187}
2188
2189
2190StatusCode ZdcNtuple :: finalize ()
2191{
2192 // This method is the mirror image of initialize(), meaning it gets
2193 // called after the last event has been processed on the worker node
2194 // and allows you to finish up any objects you created in
2195 // initialize() before they are written to disk. This is actually
2196 // fairly rare, since this happens separately for each worker node.
2197 // Most of the time you want to do your post-processing on the
2198 // submission node after all your histogram outputs have been
2199 // merged. This is different from histFinalize() in that it only
2200 // gets called on worker nodes that processed input events.
2201
2202
2203 return StatusCode::SUCCESS;
2204}
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
Helper class to provide constant type-safe access to aux data.
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
#define ANA_MSG_VERBOSE(xmsg)
Macro printing verbose messages.
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
Define enumerations for event-level ZDC data.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool msgLvl(const MSG::Level lvl) const
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
const_pointer_type ptr()
Dereference the pointer.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::vector< std::string > getListOfTriggers() const
std::vector< float > t_cc_raw_phi
Definition ZdcNtuple.h:399
const xAOD::VertexContainer * m_primaryVertices
Definition ZdcNtuple.h:122
float t_yCentroidPreGeomCorPreAvgSubtr[2]
Definition ZdcNtuple.h:274
float t_cosDeltaReactionPlaneAngle
Definition ZdcNtuple.h:282
bool reprocZdc
Definition ZdcNtuple.h:79
float t_mbts_timeDiff
Definition ZdcNtuple.h:346
std::vector< double > proton_t
Definition ZdcNtuple.h:417
float t_ZdcModuleFitT0[2][4]
Definition ZdcNtuple.h:220
std::vector< const Trig::ChainGroup * > m_rerunChainGroups
Definition ZdcNtuple.h:138
float t_yCentroid[2]
Definition ZdcNtuple.h:278
std::vector< float > t_cc_pt
Definition ZdcNtuple.h:391
TLorentzVector p_scat
Definition ZdcNtuple.h:427
const xAOD::MBTSModuleContainer * m_mbtsModules
Definition ZdcNtuple.h:120
float t_RpdChannelPileupStretchedExpFitParamErrs[2][16][3]
Definition ZdcNtuple.h:255
SG::ReadHandleKey< McEventCollection > m_mcEventCollectionName
Definition ZdcNtuple.h:111
short t_ZdcStatus[2]
Definition ZdcNtuple.h:195
std::vector< float > t_ZdcTruthParticlePy
Definition ZdcNtuple.h:210
float t_RpdChannelAmplitudeCalib[2][16]
Definition ZdcNtuple.h:259
uint32_t t_ntrk
Definition ZdcNtuple.h:362
float t_ZdcTruthEM[2]
Definition ZdcNtuple.h:202
float t_totalEt
Definition ZdcNtuple.h:320
unsigned int m_lastRunNumber
Definition ZdcNtuple.h:49
ZdcInjPulserAmpMap::Token m_injMapRunToken
Definition ZdcNtuple.h:50
float t_RPDSubtrAmpSum[2]
Definition ZdcNtuple.h:272
unsigned int t_RpdSideStatus[2]
Definition ZdcNtuple.h:265
float t_ZdcModuleChisqLGRefit[2][4]
Definition ZdcNtuple.h:242
bool enableOutputTree
Definition ZdcNtuple.h:56
float t_clusphiMax
Definition ZdcNtuple.h:406
float t_ZdcModuleT0SubLGRefit[2][4]
Definition ZdcNtuple.h:241
bool pbpb2023
Definition ZdcNtuple.h:85
bool flipDelay
Definition ZdcNtuple.h:78
unsigned short t_ZdcLucrodTriggerAmpLG[2][4]
Definition ZdcNtuple.h:232
bool zdcLaser
Definition ZdcNtuple.h:72
float t_RpdChannelAmplitude[2][16]
Definition ZdcNtuple.h:258
std::vector< uint8_t > t_trk_nPixHoles
Definition ZdcNtuple.h:379
float t_puvxz
Definition ZdcNtuple.h:292
std::vector< uint8_t > t_trk_nSctHoles
Definition ZdcNtuple.h:380
bool trackLimitReject
Definition ZdcNtuple.h:77
uint16_t t_mbts_countA
Definition ZdcNtuple.h:342
float t_fcalEtC
Definition ZdcNtuple.h:314
void processMCEventCollection()
bool lhcf2022afp
Definition ZdcNtuple.h:84
unsigned short t_ZdcLucrodTriggerSideAmp[2]
Definition ZdcNtuple.h:198
unsigned int t_RpdModuleTruthNphotons[2][16]
Definition ZdcNtuple.h:266
const xAOD::ForwardEventInfoContainer * m_mbtsInfo
Definition ZdcNtuple.h:119
bool enableCalo
Definition ZdcNtuple.h:61
bool doZdcCalib
Definition ZdcNtuple.h:92
std::vector< int > t_vx_trk_index
Definition ZdcNtuple.h:287
double dR(const double eta1, const double phi1, const double eta2, const double phi2)
float t_ZdcModuleAmpUncorr[2][4]
Definition ZdcNtuple.h:217
float t_reactionPlaneAngle[2]
Definition ZdcNtuple.h:281
std::vector< std::vector< float > > proton_track_ySlope
Definition ZdcNtuple.h:423
void processZdcNtupleFromModules()
unsigned int t_ZdcModuleMask
Definition ZdcNtuple.h:196
std::vector< float > t_trk_vz
Definition ZdcNtuple.h:370
void processInDet()
std::vector< float > t_trk_pt
Definition ZdcNtuple.h:363
uint32_t t_eventNumber
Definition ZdcNtuple.h:150
float t_RpdChannelPileupExpFitParams[2][16][2]
Definition ZdcNtuple.h:252
bool lhcf2022zdc
Definition ZdcNtuple.h:83
float t_totalEt24
Definition ZdcNtuple.h:322
uint16_t t_raw32[2][4][2][2][32]
Definition ZdcNtuple.h:354
const xAOD::EventInfo * m_eventInfo
Definition ZdcNtuple.h:113
float t_RpdChannelMaxADCCalib[2][16]
Definition ZdcNtuple.h:261
std::vector< int > t_trk_index
Definition ZdcNtuple.h:374
bool enableID
Definition ZdcNtuple.h:60
float t_clusEtMax
Definition ZdcNtuple.h:404
std::vector< std::vector< float > > proton_track_xLocal
Definition ZdcNtuple.h:419
float t_T2mbts_in_e[2][8]
Definition ZdcNtuple.h:180
uint16_t t_raw7[2][4][2][2][7]
Definition ZdcNtuple.h:351
float t_vInj
Definition ZdcNtuple.h:153
void processClusters()
bool slimmed
Definition ZdcNtuple.h:53
std::vector< const Trig::ChainGroup * > m_chainGroups
Definition ZdcNtuple.h:137
std::vector< float > t_cc_raw_e
Definition ZdcNtuple.h:400
float t_ZdcModuleChisqRatio[2][4]
Definition ZdcNtuple.h:222
float t_mbts_in_t[2][8]
Definition ZdcNtuple.h:177
std::vector< int16_t > t_vtx_ntrk
Definition ZdcNtuple.h:307
float t_ZdcAmpErr[2]
Definition ZdcNtuple.h:189
float t_vxcov[6]
Definition ZdcNtuple.h:290
float t_RpdChannelMaxADC[2][16]
Definition ZdcNtuple.h:260
float t_ZdcModuleCalibTime[2][4]
Definition ZdcNtuple.h:225
int m_eventCounter
Definition ZdcNtuple.h:133
uint32_t acceptEvent()
float t_ZdcModulePresample[2][4]
Definition ZdcNtuple.h:229
float t_ZdcNLEnergy[2]
Definition ZdcNtuple.h:192
std::vector< float > t_vtx_sumpt2_all
Definition ZdcNtuple.h:306
const xAOD::HIEventShapeContainer * m_caloSums
Definition ZdcNtuple.h:117
std::vector< int16_t > t_vtx_ntrk_all
Definition ZdcNtuple.h:305
float t_xRowCentroid[2][4]
Definition ZdcNtuple.h:279
unsigned int t_RpdChannelMaxSample[2][16]
Definition ZdcNtuple.h:262
std::vector< float > t_cc_raw_eta
Definition ZdcNtuple.h:398
float t_actIntPerCrossing
Definition ZdcNtuple.h:160
uint64_t t_trigger
Definition ZdcNtuple.h:167
bool t_centroidDecorationsAvailable
Definition ZdcNtuple.h:268
std::vector< std::vector< int16_t > > t_vtx_trk_index
Definition ZdcNtuple.h:309
std::string grlFilename
Definition ZdcNtuple.h:55
std::vector< float > t_trk_eta
Definition ZdcNtuple.h:364
int t_puvxntrk
Definition ZdcNtuple.h:293
TLorentzVector p_beam
Definition ZdcNtuple.h:426
uint16_t t_raw15[2][4][2][2][15]
Definition ZdcNtuple.h:352
bool lhcf2022
Definition ZdcNtuple.h:82
std::vector< float > t_cc_eta
Definition ZdcNtuple.h:392
TH1 * h_TCSigCut
Definition ZdcNtuple.h:339
uint16_t t_T2mbts_countCin
Definition ZdcNtuple.h:349
float t_xCentroidPreAvgSubtr[2]
Definition ZdcNtuple.h:275
float t_ZdcTrigEff[2]
Definition ZdcNtuple.h:197
float t_ZdcModuleMinDeriv2nd[2][4]
Definition ZdcNtuple.h:228
std::vector< float > t_trk_vtxz
Definition ZdcNtuple.h:371
float t_RPDChannelSubtrAmp[2][16]
Definition ZdcNtuple.h:271
float t_ZdcNLEnergyErr[2]
Definition ZdcNtuple.h:193
uint32_t t_passBits
Definition ZdcNtuple.h:155
float t_ZdcModuleChisq[2][4]
Definition ZdcNtuple.h:221
std::vector< int8_t > t_vtx_type
Definition ZdcNtuple.h:301
float t_T2mbts_out_e[2][4]
Definition ZdcNtuple.h:181
const xAOD::CaloClusterContainer * m_caloClusters
Definition ZdcNtuple.h:123
std::vector< int > t_cc_layer
Definition ZdcNtuple.h:396
uint8_t t_rpdDecodingError
Definition ZdcNtuple.h:165
float t_ZdcModuleAmpError[2][4]
Definition ZdcNtuple.h:226
float t_ZdcModuleTime[2][4]
Definition ZdcNtuple.h:218
ToolHandle< InDet::IInDetTrackSelectionTool > m_selTool
Definition ZdcNtuple.h:104
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
Definition ZdcNtuple.h:101
int t_nstrong
Definition ZdcNtuple.h:295
std::vector< float > t_trk_theta
Definition ZdcNtuple.h:367
std::vector< uint8_t > t_trk_ninPixHits
Definition ZdcNtuple.h:385
uint16_t t_T2mbts_countAin
Definition ZdcNtuple.h:348
bool m_setupTrigHist
Definition ZdcNtuple.h:135
uint32_t t_tav[16]
Definition ZdcNtuple.h:185
std::string zdcConfig
Definition ZdcNtuple.h:93
std::vector< float > t_cc_e
Definition ZdcNtuple.h:394
bool zdcOnly
Definition ZdcNtuple.h:74
double m_gapThresholds[98]
Definition ZdcNtuple.h:330
float t_mbts_timeC
Definition ZdcNtuple.h:345
float t_ZdcModuleAmpCorrLGRefit[2][4]
Definition ZdcNtuple.h:239
std::vector< float > t_cc_phi
Definition ZdcNtuple.h:393
uint32_t t_nclus
Definition ZdcNtuple.h:390
uint32_t t_tbp[16]
Definition ZdcNtuple.h:186
void processMBTS()
uint16_t t_rpdRaw[2][16][24]
Definition ZdcNtuple.h:357
std::vector< std::vector< int > > proton_track_nClusters
Definition ZdcNtuple.h:424
std::vector< int > proton_side
Definition ZdcNtuple.h:415
uint32_t t_timeStamp
Definition ZdcNtuple.h:157
float t_ZdcModuleTruthTotal[2][7]
Definition ZdcNtuple.h:244
float t_xCentroidPreGeomCorPreAvgSubtr[2]
Definition ZdcNtuple.h:273
float t_ZdcTruthInvis[2]
Definition ZdcNtuple.h:201
float t_ZdcModuleCalibAmp[2][4]
Definition ZdcNtuple.h:224
float t_ZdcModuleFitAmp[2][4]
Definition ZdcNtuple.h:219
float t_fcalEtA
Definition ZdcNtuple.h:313
float t_ZdcModuleAmpLGRefit[2][4]
Definition ZdcNtuple.h:238
float t_vx[3]
Definition ZdcNtuple.h:285
float t_ZdcModulePeakADCLG[2][4]
Definition ZdcNtuple.h:237
unsigned int t_ZdcModuleStatus[2][4]
Definition ZdcNtuple.h:223
float t_mbts_out_t[2][4]
Definition ZdcNtuple.h:178
float t_L1ET24
Definition ZdcNtuple.h:141
float t_ZdcModuleT0LGRefit[2][4]
Definition ZdcNtuple.h:240
void processGaps()
bool enableZDC
Definition ZdcNtuple.h:87
std::vector< uint8_t > t_trk_nPixDead
Definition ZdcNtuple.h:377
std::vector< int8_t > t_trk_charge
Definition ZdcNtuple.h:372
float t_ZdcModuleTruthNonEM[2][7]
Definition ZdcNtuple.h:247
int t_vxnminbias
Definition ZdcNtuple.h:297
float t_ZdcModuleAmp[2][4]
Definition ZdcNtuple.h:216
float t_fcalEtC_TT
Definition ZdcNtuple.h:316
uint32_t t_zdcEventInfoErrorWord
Definition ZdcNtuple.h:162
bool enableTrigger
Definition ZdcNtuple.h:58
float t_ZdcEnergy[2]
Definition ZdcNtuple.h:190
std::vector< std::vector< float > > t_cc_raw_samp
Definition ZdcNtuple.h:401
float t_RpdChannelPileupFrac[2][16]
Definition ZdcNtuple.h:264
bool enableRPDAmp
Definition ZdcNtuple.h:89
std::vector< float > t_ZdcTruthParticlePosy
Definition ZdcNtuple.h:206
std::vector< int16_t > t_trk_quality
Definition ZdcNtuple.h:373
bool enableTracks
Definition ZdcNtuple.h:63
std::vector< uint8_t > t_trk_nSctHits
Definition ZdcNtuple.h:376
uint16_t t_rpdRaw32[2][16][32]
Definition ZdcNtuple.h:358
float t_clusEt
Definition ZdcNtuple.h:403
std::vector< float > t_cc_raw_m
Definition ZdcNtuple.h:397
const xAOD::TrigT2MbtsBitsContainer * m_trigT2MbtsBits
Definition ZdcNtuple.h:121
std::vector< float > t_trk_d0
Definition ZdcNtuple.h:368
size_t nsamplesZdc
Definition ZdcNtuple.h:81
const xAOD::AFPProtonContainer * m_afpProtons
Definition ZdcNtuple.h:128
void writeTrack(const xAOD::TrackParticle *, const xAOD::Vertex *vertex, int)
std::vector< std::vector< float > > proton_track_zLocal
Definition ZdcNtuple.h:421
void processEventInfo()
float t_RpdChannelPileupExpFitParamErrs[2][16][2]
Definition ZdcNtuple.h:254
void processFCal()
std::vector< float > t_trk_z0
Definition ZdcNtuple.h:369
bool t_rerunDecisions[200]
Definition ZdcNtuple.h:173
float t_avgIntPerCrossing
Definition ZdcNtuple.h:159
std::vector< float > t_vtx_x
Definition ZdcNtuple.h:302
float t_ZdcTruthTotal[2]
Definition ZdcNtuple.h:200
const xAOD::TrackParticleContainer * m_trackParticles
Definition ZdcNtuple.h:124
float t_prescales[200]
Definition ZdcNtuple.h:171
bool processTriggerDecision()
float t_ZdcTime[2]
Definition ZdcNtuple.h:194
float t_T2mbts_in_t[2][8]
Definition ZdcNtuple.h:182
std::vector< float > t_vtx_y
Definition ZdcNtuple.h:303
uint32_t t_timeStampNSOffset
Definition ZdcNtuple.h:158
std::vector< float > t_vtx_z
Definition ZdcNtuple.h:304
std::vector< uint8_t > t_trk_nTrtHits
Definition ZdcNtuple.h:381
std::vector< double > proton_pt
Definition ZdcNtuple.h:411
int t_vxtype
Definition ZdcNtuple.h:288
std::vector< int > t_ZdcTruthParticlePid
Definition ZdcNtuple.h:213
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_zdcSumContainerName
Definition ZdcNtuple.h:109
unsigned short t_ZdcLucrodTriggerAmp[2][4]
Definition ZdcNtuple.h:231
void processVInjInfo()
float t_ZdcModuleBkgdMaxFraction[2][4]
Definition ZdcNtuple.h:227
asg::AnaToolHandle< IGoodRunsListSelectionTool > m_grl
Definition ZdcNtuple.h:102
unsigned int t_ZdcModuleTruthNphotons[2][7]
Definition ZdcNtuple.h:249
int nProtons
Definition ZdcNtuple.h:410
std::vector< std::vector< float > > proton_track_yLocal
Definition ZdcNtuple.h:420
std::vector< float > t_vtx_sumpt2
Definition ZdcNtuple.h:308
const xAOD::TrigDecision * m_trigDecision
Definition ZdcNtuple.h:116
std::vector< uint8_t > t_trk_nSctDead
Definition ZdcNtuple.h:378
float t_RpdChannelPileupStretchedExpFitMSE[2][16]
Definition ZdcNtuple.h:257
void processProtons()
std::vector< float > t_trk_pixeldEdx
Definition ZdcNtuple.h:387
float t_yCentroidPreAvgSubtr[2]
Definition ZdcNtuple.h:276
float t_xCentroid[2]
Definition ZdcNtuple.h:277
int t_pvindex
Definition ZdcNtuple.h:289
float t_puvxsumpt
Definition ZdcNtuple.h:294
std::vector< double > proton_eta
Definition ZdcNtuple.h:412
float t_RpdChannelBaseline[2][16]
Definition ZdcNtuple.h:251
std::vector< float > t_ZdcTruthParticlePx
Definition ZdcNtuple.h:209
std::vector< float > t_trk_phi
Definition ZdcNtuple.h:365
bool enableOutputSamples
Definition ZdcNtuple.h:57
float t_mbts_in_e[2][8]
Definition ZdcNtuple.h:175
std::vector< double > proton_eLoss
Definition ZdcNtuple.h:416
uint16_t t_raw24[2][4][2][2][24]
Definition ZdcNtuple.h:353
bool enableCentroid
Definition ZdcNtuple.h:90
float t_ZdcModulePreSampleAmp[2][4]
Definition ZdcNtuple.h:230
float t_mbts_timeA
Definition ZdcNtuple.h:344
uint16_t t_mbts_countC
Definition ZdcNtuple.h:343
unsigned int t_centroidStatus[2]
Definition ZdcNtuple.h:270
float t_clusetaMax
Definition ZdcNtuple.h:405
float t_ZdcTruthNonEM[2]
Definition ZdcNtuple.h:203
uint8_t t_bunchGroup
Definition ZdcNtuple.h:154
uint32_t t_runNumber
Definition ZdcNtuple.h:149
unsigned int zdcLowGainMode
Definition ZdcNtuple.h:75
float t_edgeGapC
Definition ZdcNtuple.h:327
int t_vxnlooseprimary
Definition ZdcNtuple.h:296
bool enableRPD
Definition ZdcNtuple.h:88
float t_ZdcAmp[2]
Definition ZdcNtuple.h:188
int t_vxngoodmuon
Definition ZdcNtuple.h:298
TTree * m_outputTree
Definition ZdcNtuple.h:148
bool zdcInj
Definition ZdcNtuple.h:73
size_t trackLimit
Definition ZdcNtuple.h:76
const xAOD::EnergySumRoI * m_lvl1EnergySumRoI
Definition ZdcNtuple.h:125
float t_RpdChannelPileupExpFitMSE[2][16]
Definition ZdcNtuple.h:256
std::vector< std::vector< int > > proton_track_stationID
Definition ZdcNtuple.h:418
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_zdcModuleContainerName
Definition ZdcNtuple.h:107
float t_totalEt24_TTsum
Definition ZdcNtuple.h:323
float t_ZdcTruthEscaped[2]
Definition ZdcNtuple.h:204
float t_ZdcModulePeakADCHG[2][4]
Definition ZdcNtuple.h:236
std::shared_ptr< ZdcInjPulserAmpMap > m_zdcInjPulserAmpMap
Definition ZdcNtuple.h:130
std::vector< float > t_ZdcTruthParticleEnergy
Definition ZdcNtuple.h:212
std::vector< double > proton_e
Definition ZdcNtuple.h:414
bool useGRL
Definition ZdcNtuple.h:54
bool oo2025
Definition ZdcNtuple.h:86
float t_fcalEtA_TT
Definition ZdcNtuple.h:315
float t_vxsumpt2
Definition ZdcNtuple.h:291
uint32_t t_bcid
Definition ZdcNtuple.h:152
float t_ZdcEnergyErr[2]
Definition ZdcNtuple.h:191
float t_ZdcModuleTruthEM[2][7]
Definition ZdcNtuple.h:246
std::vector< float > t_ZdcTruthParticleTime
Definition ZdcNtuple.h:208
std::vector< uint8_t > t_trk_nPixHits
Definition ZdcNtuple.h:375
uint32_t t_extendedLevel1ID
Definition ZdcNtuple.h:156
unsigned short t_ZdcLucrodTriggerSideAmpLG[2]
Definition ZdcNtuple.h:199
unsigned int t_RpdChannelStatus[2][16]
Definition ZdcNtuple.h:263
float t_L1ET
Definition ZdcNtuple.h:140
uint16_t t_raw40[2][4][2][2][40]
Definition ZdcNtuple.h:355
std::string auxSuffix
Definition ZdcNtuple.h:80
bool writeOnlyTriggers
Definition ZdcNtuple.h:59
std::vector< float > t_ZdcTruthParticlePosz
Definition ZdcNtuple.h:207
char t_centroidEventValid
Definition ZdcNtuple.h:269
bool t_decisions[200]
Definition ZdcNtuple.h:172
bool enableClusters
Definition ZdcNtuple.h:62
asg::AnaToolHandle< ZDC::IZdcAnalysisTool > m_zdcAnalysisTool
Definition ZdcNtuple.h:103
float t_totalEt_TTsum
Definition ZdcNtuple.h:321
std::vector< float > t_ZdcTruthParticlePz
Definition ZdcNtuple.h:211
uint16_t t_rpdRaw40[2][16][40]
Definition ZdcNtuple.h:359
uint32_t t_trigger_TBP
Definition ZdcNtuple.h:168
std::vector< std::vector< float > > proton_track_xSlope
Definition ZdcNtuple.h:422
int t_vxntrk
Definition ZdcNtuple.h:286
bool m_isMC
Definition ZdcNtuple.h:134
void setupTriggerHistos()
std::vector< float > t_ZdcTruthParticlePosx
Definition ZdcNtuple.h:205
int trackQuality(const xAOD::TrackParticle *tp, const xAOD::Vertex *vertex)
float t_yColCentroid[2][4]
Definition ZdcNtuple.h:280
float t_ZdcModuleTruthInvis[2][7]
Definition ZdcNtuple.h:245
std::vector< uint8_t > t_trk_nexPixHits
Definition ZdcNtuple.h:386
float m_gapPtMin
Definition ZdcNtuple.h:328
float t_ZdcModuleMaxADCHG[2][4]
Definition ZdcNtuple.h:234
std::vector< float > t_cc_sig
Definition ZdcNtuple.h:395
std::vector< double > proton_phi
Definition ZdcNtuple.h:413
std::vector< uint8_t > t_trk_inPixHits
Definition ZdcNtuple.h:383
float t_T2mbts_out_t[2][4]
Definition ZdcNtuple.h:183
float t_fcalEt
Definition ZdcNtuple.h:312
uint8_t t_zdcEventInfoError
Definition ZdcNtuple.h:161
std::vector< int > t_ZdcTruthParticleStatus
Definition ZdcNtuple.h:214
float t_RpdChannelPileupStretchedExpFitParams[2][16][3]
Definition ZdcNtuple.h:253
float t_ZdcModuleMaxADCLG[2][4]
Definition ZdcNtuple.h:235
std::vector< uint8_t > t_trk_nTrtOutliers
Definition ZdcNtuple.h:382
uint32_t t_lumiBlock
Definition ZdcNtuple.h:151
float t_edgeGapA
Definition ZdcNtuple.h:326
bool zdcCalib
Definition ZdcNtuple.h:71
std::vector< float > t_trk_e
Definition ZdcNtuple.h:366
const xAOD::HIEventShapeContainer * m_eventShapes
Definition ZdcNtuple.h:118
std::vector< uint8_t > t_trk_exPixHits
Definition ZdcNtuple.h:384
float t_ZdcModuleMaxADC[2][4]
Definition ZdcNtuple.h:233
float t_ZdcModuleTruthEscaped[2][7]
Definition ZdcNtuple.h:248
uint8_t t_zdcDecodingError
Definition ZdcNtuple.h:164
float t_mbts_out_e[2][4]
Definition ZdcNtuple.h:176
@ CELL_SIGNIFICANCE
Cell significance = E/sig of the cell with the largest |E|/sig.
@ CELL_SIG_SAMPLING
CaloSample of the cell with the largest |E|/sig.
CaloSampling::CaloSample CaloSample
@ Tile
The Tile calorimeter.
@ Core
Core flags describing the event.
@ ForwardDet
The forward detectors.
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.
float z() const
Returns the z position.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
float y() const
Returns the y position.
VxType::VertexType vertexType() const
The type of the vertex.
float x() const
Returns the x position.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition index.py:1
@ PileUp
Pile-up vertex.
@ PriVtx
Primary vertex.
ZdcModule_v1 ZdcModule
Definition ZdcModule.h:15
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
@ pixeldEdx
the dE/dx estimate, calculated using the pixel clusters [?
Extra patterns decribing particle interation process.
TChain * tree