|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | +// |
| 12 | +/// \file lumiStabilityPP.cxx |
| 13 | +/// \brief Analysis over BCs to study the luminosity stability along time for pp collisions |
| 14 | +/// |
| 15 | +/// \author Fabrizio Grosa (fabrizio.grosa@cern.ch), CERN |
| 16 | + |
| 17 | +#include "Common/CCDB/ctpRateFetcher.h" |
| 18 | +#include "Common/Core/MetadataHelper.h" |
| 19 | +#include "Common/DataModel/Centrality.h" |
| 20 | +#include "Common/DataModel/EventSelection.h" |
| 21 | +#include "Common/DataModel/FT0Corrected.h" |
| 22 | + |
| 23 | +#include "CCDB/BasicCCDBManager.h" |
| 24 | +#include "DataFormatsFT0/Digit.h" |
| 25 | +#include "DataFormatsParameters/AggregatedRunInfo.h" |
| 26 | +#include "DataFormatsParameters/GRPLHCIFData.h" |
| 27 | +#include "Framework/ASoA.h" |
| 28 | +#include "Framework/AnalysisDataModel.h" |
| 29 | +#include "Framework/AnalysisTask.h" |
| 30 | +#include "Framework/runDataProcessing.h" |
| 31 | + |
| 32 | +#include <limits> |
| 33 | +#include <map> |
| 34 | +#include <string> |
| 35 | +#include <vector> |
| 36 | + |
| 37 | +o2::common::core::MetadataHelper metadataInfo; // Metadata helper |
| 38 | + |
| 39 | +namespace o2 |
| 40 | +{ |
| 41 | +namespace lumi |
| 42 | +{ |
| 43 | +enum TriggerAliases { AllBCs = 0, |
| 44 | + FT0Vtx = 1, |
| 45 | + FT0CE = 2, |
| 46 | + FDD = 3, |
| 47 | + NTriggerAliases }; |
| 48 | +enum BCCategories { BCA = 0, // A side BCs (bunch-crossings that had beam only from A side) |
| 49 | + BCB = 1, // B type BCs (bunch-crossings that had beam from both sides) |
| 50 | + BCC = 2, // C side BCs (bunch-crossings that had beam only from C side) |
| 51 | + BCE = 3, // empty BCs (bunch-crossings that did not have beam from either side) |
| 52 | + BCL = 4, // leading BCs (bunch-crossings that did not have interacting bunches for a configurable number of preceding BCs) |
| 53 | + BCSL = 5, // super-leading BCs (bunch-crossings that did not have FDD/FT0 activity for a configurable number of preceding BCs) |
| 54 | + NBCCategories }; |
| 55 | +} // namespace lumi |
| 56 | +namespace aod |
| 57 | +{ |
| 58 | +// Columns to store the information about the presence of FT0 and FDD signals associated to a given BC |
| 59 | +DECLARE_SOA_TABLE(BcDetectorInfo, "AOD", "BCDETECTORINFO", //! |
| 60 | + indices::FT0Id, |
| 61 | + indices::FDDId); |
| 62 | +} // namespace aod |
| 63 | +} // namespace o2 |
| 64 | + |
| 65 | +using namespace o2; |
| 66 | +using namespace o2::framework; |
| 67 | +using namespace o2::framework::expressions; |
| 68 | +using namespace o2::lumi; |
| 69 | + |
| 70 | +using BCsWithTimeStamps = soa::Join<aod::BCs, aod::Timestamps, aod::BcDetectorInfo>; |
| 71 | + |
| 72 | +struct BuildBcFlagTable { |
| 73 | + |
| 74 | + Produces<aod::BcDetectorInfo> bcFlags; |
| 75 | + |
| 76 | + void init(InitContext&) {} |
| 77 | + |
| 78 | + void process(aod::BC const& bc, |
| 79 | + aod::FT0s const& ft0s, |
| 80 | + aod::FDDs const& fdds) |
| 81 | + { |
| 82 | + int64_t idxFT0{-1}, idxFDD{-1}; |
| 83 | + for (const auto& ft0 : ft0s) { |
| 84 | + if (ft0.bcId() == bc.globalIndex()) { |
| 85 | + idxFT0 = ft0.globalIndex(); |
| 86 | + break; |
| 87 | + } |
| 88 | + } |
| 89 | + for (const auto& fdd : fdds) { |
| 90 | + if (fdd.bcId() == bc.globalIndex()) { |
| 91 | + idxFDD = fdd.globalIndex(); |
| 92 | + break; |
| 93 | + } |
| 94 | + } |
| 95 | + bcFlags(idxFT0, idxFDD); |
| 96 | + } |
| 97 | +}; |
| 98 | + |
| 99 | +struct LumiStabilityPP { |
| 100 | + |
| 101 | + Configurable<bool> doBCA{"doBCA", false, "Create and fill histograms for the BCs of type A"}; |
| 102 | + Configurable<bool> doBCB{"doBCB", true, "Create and fill histograms for the BCs of type B"}; |
| 103 | + Configurable<bool> doBCC{"doBCC", false, "Create and fill histograms for the BCs of type C"}; |
| 104 | + Configurable<bool> doBCE{"doBCE", false, "Create and fill histograms for the BCs of type E"}; |
| 105 | + Configurable<bool> doBCL{"doBCL", false, "Create and fill histograms for leading BCs of type B"}; |
| 106 | + Configurable<bool> doBCSL{"doBCSL", false, "Create and fill histograms for super-leading BCs (no preceding FT0/FDD activity) of type B"}; |
| 107 | + Configurable<int> numEmptyBCsBeforeLeadingBC{"numEmptyBCsBeforeLeadingBC", 5, "Number of empty BCs before a leading BC"}; |
| 108 | + Configurable<bool> requireNoT0ForSLBC{"requireNoT0ForSLBC", false, "Require no T0 signal for definition of super leading BC (otherwise only no FDD)"}; |
| 109 | + |
| 110 | + std::bitset<o2::constants::lhc::LHCMaxBunches> beamPatternA, beamPatternC; |
| 111 | + std::bitset<o2::constants::lhc::LHCMaxBunches> bcPatternA, bcPatternC, bcPatternB, bcPatternE, bcPatternL; |
| 112 | + const int nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches; |
| 113 | + |
| 114 | + parameters::GRPLHCIFData* mLHCIFdata = nullptr; |
| 115 | + int runNumber{-1}; |
| 116 | + ctpRateFetcher mRateFetcher; |
| 117 | + |
| 118 | + HistogramRegistry registry{"registry"}; |
| 119 | + |
| 120 | + std::array<std::array<std::map<int, std::shared_ptr<TH1>>, NBCCategories>, NTriggerAliases> histBcVsTime; |
| 121 | + std::array<std::array<std::map<int, std::shared_ptr<TH1>>, NBCCategories>, NTriggerAliases> histBcVsBcId; |
| 122 | + std::map<int, std::shared_ptr<TH1>> histNBcsVsTime; |
| 123 | + std::map<int, std::shared_ptr<TH1>> histNBcsVsBcId; |
| 124 | + std::map<int, std::shared_ptr<TH1>> histTfPerMin; |
| 125 | + std::map<int, std::shared_ptr<TH1>> histBcHasFT0; |
| 126 | + std::map<int, std::shared_ptr<TH1>> histBcHasFDD; |
| 127 | + |
| 128 | + static constexpr std::string_view NBCsVsTimeHistNames[NTriggerAliases][NBCCategories] = |
| 129 | + {{"AllBCs/BC_A/nBCsVsTime", "AllBCs/BC_B/nBCsVsTime", "AllBCs/BC_C/nBCsVsTime", "AllBCs/BC_E/nBCsVsTime", "AllBCs/BC_L/nBCsVsTime", "AllBCs/BC_SL/nBCsVsTime"}, |
| 130 | + {"FT0VTx/BC_A/nBCsVsTime", "FT0VTx/BC_B/nBCsVsTime", "FT0VTx/BC_C/nBCsVsTime", "FT0VTx/BC_E/nBCsVsTime", "FT0VTx/BC_L/nBCsVsTime", "FT0VTx/BC_SL/nBCsVsTime"}, |
| 131 | + {"FT0CE/BC_A/nBCsVsTime", "FT0CE/BC_B/nBCsVsTime", "FT0CE/BC_C/nBCsVsTime", "FT0CE/BC_E/nBCsVsTime", "FT0CE/BC_L/nBCsVsTime", "FT0CE/BC_SL/nBCsVsTime"}, |
| 132 | + {"FDD/BC_A/nBCsVsTime", "FDD/BC_B/nBCsVsTime", "FDD/BC_C/nBCsVsTime", "FDD/BC_E/nBCsVsTime", "FDD/BC_L/nBCsVsTime", "FDD/BC_SL/nBCsVsTime"}}; |
| 133 | + |
| 134 | + static constexpr std::string_view NBCsVsBCIDHistNames[NTriggerAliases][NBCCategories] = |
| 135 | + {{"AllBCs/BC_A/nBCsVsBCID", "AllBCs/BC_B/nBCsVsBCID", "AllBCs/BC_C/nBCsVsBCID", "AllBCs/BC_E/nBCsVsBCID", "AllBCs/BC_L/nBCsVsBCID", "AllBCs/BC_SL/nBCsVsBCID"}, |
| 136 | + {"FT0VTx/BC_A/nBCsVsBCID", "FT0VTx/BC_B/nBCsVsBCID", "FT0VTx/BC_C/nBCsVsBCID", "FT0VTx/BC_E/nBCsVsBCID", "FT0VTx/BC_L/nBCsVsBCID", "FT0VTx/BC_SL/nBCsVsBCID"}, |
| 137 | + {"FT0CE/BC_A/nBCsVsBCID", "FT0CE/BC_B/nBCsVsBCID", "FT0CE/BC_C/nBCsVsBCID", "FT0CE/BC_E/nBCsVsBCID", "FT0CE/BC_L/nBCsVsBCID", "FT0CE/BC_SL/nBCsVsBCID"}, |
| 138 | + {"FDD/BC_A/nBCsVsBCID", "FDD/BC_B/nBCsVsBCID", "FDD/BC_C/nBCsVsBCID", "FDD/BC_E/nBCsVsBCID", "FDD/BC_L/nBCsVsBCID", "FDD/BC_SL/nBCsVsBCID"}}; |
| 139 | + |
| 140 | + const AxisSpec timeAxis{1440, 0., 1440., "#bf{t-t_{SOF} (min)}"}, bcIDAxis{nBCsPerOrbit, -0.5, static_cast<float>(nBCsPerOrbit) - 0.5, "#bf{BC ID in orbit}"}; |
| 141 | + |
| 142 | + int64_t bcSOR; |
| 143 | + int nBCsPerTF; |
| 144 | + int64_t currentTFid = -1; |
| 145 | + |
| 146 | + void init(InitContext&) {} |
| 147 | + |
| 148 | + void createHistograms() |
| 149 | + { |
| 150 | + if (histNBcsVsTime[runNumber]) { // histograms for this run already there |
| 151 | + return; |
| 152 | + } |
| 153 | + |
| 154 | + histNBcsVsTime[runNumber] = registry.add<TH1>(Form("%d/FT0Vtx_EvSel/nBCsVsTime", runNumber), "Time of TVX triggered BCs since the start of fill;;#bf{#it{N}_{BC}}", HistType::kTH1D, {timeAxis}); |
| 155 | + histNBcsVsBcId[runNumber] = registry.add<TH1>(Form("%d/nBCsVsBCID", runNumber), "Time of TVX triggered BCs since the start of fill;#bf{t-t_{SOF} (min)};#bf{#it{N}_{BC}}", HistType::kTH1D, {bcIDAxis}); |
| 156 | + histTfPerMin[runNumber] = registry.add<TH1>(Form("%d/TFsPerMinute", runNumber), "TFs seen in this minute (to account for failed jobs);#bf{t-t_{SOF} (min)};#bf{#it{N}_{TFs}}", HistType::kTH1D, {timeAxis}); |
| 157 | + |
| 158 | + histBcHasFT0[runNumber] = registry.add<TH2>(Form("%d/FITQA/BCHasFT0", runNumber), "Does the BC have FT0?;BC has FT0;TVX triggered according to CTP;#bf{#it{N}_{BC}}", HistType::kTH2D, {{2, -0.5, 1.5}, {2, -0.5, 1.5}}); |
| 159 | + histBcHasFT0[runNumber]->GetYaxis()->SetBinLabel(1, "No CTP trigger"); |
| 160 | + histBcHasFT0[runNumber]->GetYaxis()->SetBinLabel(2, "CTP triggered"); |
| 161 | + histBcHasFT0[runNumber]->GetXaxis()->SetBinLabel(1, "No found FT0"); |
| 162 | + histBcHasFT0[runNumber]->GetXaxis()->SetBinLabel(2, "Found FT0"); |
| 163 | + histBcHasFDD[runNumber] = registry.add<TH2>(Form("%d/FITQA/BCHasFDD", runNumber), "Does the BC have FDD?;BC has FDD;FDD triggered according to CTP;#bf{#it{N}_{BC}}", HistType::kTH2D, {{2, -0.5, 1.5}, {2, -0.5, 1.5}}); |
| 164 | + histBcHasFDD[runNumber]->GetYaxis()->SetBinLabel(1, "No CTP trigger"); |
| 165 | + histBcHasFDD[runNumber]->GetYaxis()->SetBinLabel(2, "CTP triggered"); |
| 166 | + histBcHasFDD[runNumber]->GetXaxis()->SetBinLabel(1, "No found FDD"); |
| 167 | + histBcHasFDD[runNumber]->GetXaxis()->SetBinLabel(2, "Found FDD"); |
| 168 | + |
| 169 | + for (int iTrigger{0}; iTrigger < NTriggerAliases; ++iTrigger) { |
| 170 | + for (int iBCCategory{0}; iBCCategory < NBCCategories; ++iBCCategory) { // Don't do SL BCs here |
| 171 | + if ((iBCCategory == BCA && doBCA) || (iBCCategory == BCB && doBCB) || (iBCCategory == BCC && doBCC) || (iBCCategory == BCE && doBCE) || (iBCCategory == BCL && doBCL) || (iBCCategory == BCSL && doBCSL)) { |
| 172 | + histBcVsTime[iTrigger][iBCCategory][runNumber] = registry.add<TH1>(Form("%d/%s", runNumber, std::string(NBCsVsTimeHistNames[iTrigger][iBCCategory]).c_str()), "Time of triggered BCs since the start of fill;#bf{t-t_{SOF} (min)};#bf{#it{N}_{BC}}", HistType::kTH1D, {timeAxis}); |
| 173 | + histBcVsBcId[iTrigger][iBCCategory][runNumber] = registry.add<TH1>(Form("%d/%s", runNumber, std::string(NBCsVsBCIDHistNames[iTrigger][iBCCategory]).c_str()), "BC ID of triggered BCs;#bf{BC ID in orbit};#bf{#it{N}_{BC}}", HistType::kTH1D, {bcIDAxis}); |
| 174 | + } |
| 175 | + } |
| 176 | + } |
| 177 | + } |
| 178 | + |
| 179 | + void setLHCIFData(const auto& bc) |
| 180 | + { |
| 181 | + if (runNumber == bc.runNumber()) { |
| 182 | + return; |
| 183 | + } |
| 184 | + |
| 185 | + auto& ccdbMgr = o2::ccdb::BasicCCDBManager::instance(); |
| 186 | + uint64_t timeStamp = bc.timestamp(); |
| 187 | + |
| 188 | + std::map<std::string, std::string> metadata; |
| 189 | + mLHCIFdata = ccdbMgr.getSpecific<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", timeStamp, metadata); |
| 190 | + if (mLHCIFdata == nullptr) { |
| 191 | + LOG(fatal) << "GRPLHCIFData not in database, timestamp:" << timeStamp; |
| 192 | + } |
| 193 | + |
| 194 | + runNumber = bc.runNumber(); |
| 195 | + LOG(info) << "LHCIF data fetched for run " << runNumber << " and timestamp " << timeStamp; |
| 196 | + createHistograms(); |
| 197 | + |
| 198 | + beamPatternA = mLHCIFdata->getBunchFilling().getBeamPattern(0); |
| 199 | + beamPatternC = mLHCIFdata->getBunchFilling().getBeamPattern(1); |
| 200 | + bcPatternA = beamPatternA & ~beamPatternC; |
| 201 | + bcPatternC = ~beamPatternA & beamPatternC; |
| 202 | + bcPatternB = beamPatternA & beamPatternC; |
| 203 | + bcPatternE = ~beamPatternA & ~beamPatternC; |
| 204 | + |
| 205 | + // Create bcPatternL: leading BCs of type B that follow at least "numEmptyBCsBeforeLeadingBC" empty BCs |
| 206 | + bcPatternL.reset(); // Initialize all bits to false |
| 207 | + LOG(info) << "Starting to create bcPatternL from bcPatternB"; |
| 208 | + LOG(info) << "Total number of BCs to check: " << o2::constants::lhc::LHCMaxBunches; |
| 209 | + |
| 210 | + int totalLeadingBCs = 0; |
| 211 | + for (int iBC = 0; iBC < o2::constants::lhc::LHCMaxBunches; iBC++) { |
| 212 | + if (bcPatternB[iBC]) { // Check if current BC is of type B |
| 213 | + int emptyBCsBefore = 0; // Count how many consecutive BCs before this one are NOT type B |
| 214 | + for (int j = 1; j <= numEmptyBCsBeforeLeadingBC; j++) { |
| 215 | + int prevBC = (iBC - j + o2::constants::lhc::LHCMaxBunches) % o2::constants::lhc::LHCMaxBunches; // Protection for BCs at small indices to check the end of the orbit |
| 216 | + if (!bcPatternB[prevBC]) { |
| 217 | + emptyBCsBefore++; |
| 218 | + } else { |
| 219 | + break; // Stop counting if we hit a type B BC |
| 220 | + } |
| 221 | + } |
| 222 | + if (emptyBCsBefore >= numEmptyBCsBeforeLeadingBC) { // If we found at least numEmptyBCsBeforeLeadingBC empty BCs before this one, mark it as leading |
| 223 | + bcPatternL[iBC] = true; |
| 224 | + totalLeadingBCs++; |
| 225 | + } |
| 226 | + } |
| 227 | + } |
| 228 | + LOG(info) << "bcPatternL creation complete. Total leading BCs found: " << totalLeadingBCs; |
| 229 | + |
| 230 | + auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo(o2::ccdb::BasicCCDBManager::instance(), runNumber, metadataInfo.get("LPMProductionTag")); |
| 231 | + bcSOR = runInfo.orbitSOR * nBCsPerOrbit; // first bc of the first orbit |
| 232 | + LOG(info) << "BC SOR: " << bcSOR << " (orbit SOR: " << runInfo.orbitSOR << ") NBCs per orbit: " << nBCsPerOrbit; |
| 233 | + nBCsPerTF = runInfo.orbitsPerTF * nBCsPerOrbit; // duration of TF in bcs |
| 234 | + |
| 235 | + return; |
| 236 | + } |
| 237 | + |
| 238 | + float getTimeSinceSOF(const auto& bc) |
| 239 | + { |
| 240 | + return (bc.timestamp() - mLHCIFdata->getFillNumberTime()) / 1e3 / 60; // Convert to minutes |
| 241 | + } |
| 242 | + |
| 243 | + template <int iTrigger, int iBCCategory> |
| 244 | + void fillHistograms(float timeSinceSOF, int64_t localBC) |
| 245 | + { |
| 246 | + histBcVsTime[iTrigger][iBCCategory][runNumber]->Fill(timeSinceSOF); |
| 247 | + histBcVsBcId[iTrigger][iBCCategory][runNumber]->Fill(localBC); |
| 248 | + } |
| 249 | + |
| 250 | + void process(BCsWithTimeStamps const& bcs, |
| 251 | + aod::FT0s const&, |
| 252 | + aod::FDDs const&) |
| 253 | + { |
| 254 | + int64_t globalBCIdOfLastBCWithActivity = 0; |
| 255 | + for (const auto& bc : bcs) { |
| 256 | + |
| 257 | + if (bc.timestamp() == 0) { |
| 258 | + continue; |
| 259 | + } |
| 260 | + |
| 261 | + setLHCIFData(bc); |
| 262 | + |
| 263 | + float timeSinceSOF = getTimeSinceSOF(bc); |
| 264 | + bool isTriggerTVX = (bc.has_ft0() ? TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitVertex) : false); |
| 265 | + |
| 266 | + if (isTriggerTVX) { |
| 267 | + histNBcsVsTime[runNumber]->Fill(timeSinceSOF); |
| 268 | + } |
| 269 | + |
| 270 | + int64_t globalBC = bc.globalBC(); |
| 271 | + int localBC = globalBC % nBCsPerOrbit; |
| 272 | + |
| 273 | + bool isSuperLeadingBc{true}; |
| 274 | + if (globalBC - globalBCIdOfLastBCWithActivity < numEmptyBCsBeforeLeadingBC) { |
| 275 | + isSuperLeadingBc = false; // not a super-leading BC |
| 276 | + } |
| 277 | + |
| 278 | + if (bc.has_fdd() || (requireNoT0ForSLBC && bc.has_ft0())) { |
| 279 | + globalBCIdOfLastBCWithActivity = globalBC; |
| 280 | + } |
| 281 | + |
| 282 | + if (!bcPatternB[localBC]) { |
| 283 | + isSuperLeadingBc = false; // not a super-leading BC |
| 284 | + } |
| 285 | + |
| 286 | + int64_t thisTFid = (globalBC - bcSOR) / nBCsPerTF; |
| 287 | + |
| 288 | + if (thisTFid != currentTFid) { |
| 289 | + currentTFid = thisTFid; |
| 290 | + histNBcsVsTime[runNumber]->Fill(timeSinceSOF); |
| 291 | + } |
| 292 | + |
| 293 | + std::bitset<64> ctpInputMask(bc.inputMask()); |
| 294 | + |
| 295 | + histBcHasFT0[runNumber]->Fill(bc.has_ft0(), ctpInputMask.test(2)); |
| 296 | + histBcHasFDD[runNumber]->Fill(bc.has_fdd(), ctpInputMask.test(15)); |
| 297 | + |
| 298 | + for (int iTrigger{0}; iTrigger < NTriggerAliases; ++iTrigger) { |
| 299 | + for (int iBCCategory{0}; iBCCategory < NBCCategories; ++iBCCategory) { // Don't do SL BCs here |
| 300 | + if ((iBCCategory == BCA && doBCA) || (iBCCategory == BCB && doBCB) || (iBCCategory == BCC && doBCC) || (iBCCategory == BCE && doBCE) || (iBCCategory == BCL && doBCL)) { |
| 301 | + if (iTrigger == AllBCs) { |
| 302 | + if (iBCCategory == BCA && bcPatternA[localBC]) |
| 303 | + fillHistograms<AllBCs, BCA>(timeSinceSOF, localBC); |
| 304 | + if (iBCCategory == BCB && bcPatternB[localBC]) |
| 305 | + fillHistograms<AllBCs, BCB>(timeSinceSOF, localBC); |
| 306 | + if (iBCCategory == BCC && bcPatternC[localBC]) |
| 307 | + fillHistograms<AllBCs, BCC>(timeSinceSOF, localBC); |
| 308 | + if (iBCCategory == BCE && bcPatternE[localBC]) |
| 309 | + fillHistograms<AllBCs, BCE>(timeSinceSOF, localBC); |
| 310 | + if (iBCCategory == BCL && bcPatternL[localBC]) |
| 311 | + fillHistograms<AllBCs, BCL>(timeSinceSOF, localBC); |
| 312 | + if (iBCCategory == BCSL && isSuperLeadingBc) |
| 313 | + fillHistograms<AllBCs, BCSL>(timeSinceSOF, localBC); |
| 314 | + } |
| 315 | + if (iTrigger == FT0Vtx && ctpInputMask.test(2)) { |
| 316 | + if (iBCCategory == BCA && bcPatternA[localBC]) |
| 317 | + fillHistograms<FT0Vtx, BCA>(timeSinceSOF, localBC); |
| 318 | + if (iBCCategory == BCB && bcPatternB[localBC]) |
| 319 | + fillHistograms<FT0Vtx, BCB>(timeSinceSOF, localBC); |
| 320 | + if (iBCCategory == BCC && bcPatternC[localBC]) |
| 321 | + fillHistograms<FT0Vtx, BCC>(timeSinceSOF, localBC); |
| 322 | + if (iBCCategory == BCE && bcPatternE[localBC]) |
| 323 | + fillHistograms<FT0Vtx, BCE>(timeSinceSOF, localBC); |
| 324 | + if (iBCCategory == BCL && bcPatternL[localBC]) |
| 325 | + fillHistograms<FT0Vtx, BCL>(timeSinceSOF, localBC); |
| 326 | + if (iBCCategory == BCSL && isSuperLeadingBc) |
| 327 | + fillHistograms<FT0Vtx, BCSL>(timeSinceSOF, localBC); |
| 328 | + } |
| 329 | + if (iTrigger == FT0CE && ctpInputMask.test(4)) { |
| 330 | + if (iBCCategory == BCA && bcPatternA[localBC]) |
| 331 | + fillHistograms<FT0CE, BCA>(timeSinceSOF, localBC); |
| 332 | + if (iBCCategory == BCB && bcPatternB[localBC]) |
| 333 | + fillHistograms<FT0CE, BCB>(timeSinceSOF, localBC); |
| 334 | + if (iBCCategory == BCC && bcPatternC[localBC]) |
| 335 | + fillHistograms<FT0CE, BCC>(timeSinceSOF, localBC); |
| 336 | + if (iBCCategory == BCE && bcPatternE[localBC]) |
| 337 | + fillHistograms<FT0CE, BCE>(timeSinceSOF, localBC); |
| 338 | + if (iBCCategory == BCL && bcPatternL[localBC]) |
| 339 | + fillHistograms<FT0CE, BCL>(timeSinceSOF, localBC); |
| 340 | + } |
| 341 | + if (iTrigger == FDD && ctpInputMask.test(15)) { |
| 342 | + if (iBCCategory == BCA && bcPatternA[localBC]) |
| 343 | + fillHistograms<FDD, BCA>(timeSinceSOF, localBC); |
| 344 | + if (iBCCategory == BCB && bcPatternB[localBC]) |
| 345 | + fillHistograms<FDD, BCB>(timeSinceSOF, localBC); |
| 346 | + if (iBCCategory == BCC && bcPatternC[localBC]) |
| 347 | + fillHistograms<FDD, BCC>(timeSinceSOF, localBC); |
| 348 | + if (iBCCategory == BCE && bcPatternE[localBC]) |
| 349 | + fillHistograms<FDD, BCE>(timeSinceSOF, localBC); |
| 350 | + if (iBCCategory == BCL && bcPatternL[localBC]) |
| 351 | + fillHistograms<FDD, BCL>(timeSinceSOF, localBC); |
| 352 | + if (iBCCategory == BCSL && isSuperLeadingBc) |
| 353 | + fillHistograms<FDD, BCSL>(timeSinceSOF, localBC); |
| 354 | + } |
| 355 | + } |
| 356 | + } |
| 357 | + } |
| 358 | + histNBcsVsBcId[runNumber]->Fill(localBC); |
| 359 | + } |
| 360 | + } |
| 361 | +}; |
| 362 | + |
| 363 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 364 | +{ |
| 365 | + metadataInfo.initMetadata(cfgc); |
| 366 | + return WorkflowSpec{adaptAnalysisTask<BuildBcFlagTable>(cfgc), adaptAnalysisTask<LumiStabilityPP>(cfgc)}; |
| 367 | +} |
0 commit comments