Skip to content

Commit 89cfc4f

Browse files
authored
[PWGDQ,PWGEM] Remove unused code (#10892)
1 parent e478b4d commit 89cfc4f

File tree

9 files changed

+44
-174
lines changed

9 files changed

+44
-174
lines changed

PWGDQ/Core/VarManager.cxx

Lines changed: 6 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ bool VarManager::fgUsedVars[VarManager::kNVars] = {false};
2828
bool VarManager::fgUsedKF = false;
2929
float VarManager::fgMagField = 0.5;
3030
float VarManager::fgValues[VarManager::kNVars] = {0.0f};
31-
std::map<int, int> VarManager::fgRunMap;
32-
TString VarManager::fgRunStr = "";
33-
std::vector<int> VarManager::fgRunList = {0};
3431
float VarManager::fgCenterOfMassEnergy = 13600; // GeV
3532
float VarManager::fgMassofCollidingParticle = 9.382720; // GeV
3633
float VarManager::fgTPCInterSectorBoundary = 1.0; // cm
@@ -110,69 +107,6 @@ void VarManager::ResetValues(int startValue, int endValue, float* values)
110107
}
111108
}
112109

113-
//__________________________________________________________________
114-
void VarManager::SetRunNumbers(int n, int* runs)
115-
{
116-
//
117-
// maps the list of runs such that one can plot the list of runs nicely in a histogram axis
118-
//
119-
for (int i = 0; i < n; ++i) {
120-
fgRunMap[runs[i]] = i + 1;
121-
fgRunStr += Form("%d;", runs[i]);
122-
}
123-
}
124-
125-
//__________________________________________________________________
126-
void VarManager::SetRunNumbers(std::vector<int> runs)
127-
{
128-
//
129-
// maps the list of runs such that one can plot the list of runs nicely in a histogram axis
130-
//
131-
int i = 0;
132-
for (auto run = runs.begin(); run != runs.end(); run++, i++) {
133-
fgRunMap[*run] = i + 1;
134-
fgRunStr += Form("%d;", *run);
135-
}
136-
fgRunList = runs;
137-
}
138-
139-
//__________________________________________________________________
140-
void VarManager::SetDummyRunlist(int InitRunnumber)
141-
{
142-
//
143-
// runlist for the different periods
144-
fgRunList.clear();
145-
fgRunList.push_back(InitRunnumber);
146-
fgRunList.push_back(InitRunnumber + 100);
147-
}
148-
149-
//__________________________________________________________________
150-
int VarManager::GetDummyFirst()
151-
{
152-
//
153-
// Get the fist index of the vector of run numbers
154-
//
155-
return fgRunList[0];
156-
}
157-
//__________________________________________________________________
158-
int VarManager::GetDummyLast()
159-
{
160-
//
161-
// Get the last index of the vector of run numbers
162-
//
163-
return fgRunList[fgRunList.size() - 1];
164-
}
165-
//_________________________________________________________________
166-
float VarManager::GetRunIndex(double Runnumber)
167-
{
168-
//
169-
// Get the index of RunNumber in it's runlist
170-
//
171-
int runNumber = static_cast<int>(Runnumber);
172-
auto runIndex = std::find(fgRunList.begin(), fgRunList.end(), runNumber);
173-
float index = std::distance(fgRunList.begin(), runIndex);
174-
return index;
175-
}
176110
//__________________________________________________________________
177111
void VarManager::SetCollisionSystem(TString system, float energy)
178112
{
@@ -191,15 +125,12 @@ void VarManager::SetCollisionSystem(TString system, float energy)
191125
}
192126

193127
//__________________________________________________________________
194-
void VarManager::FillEventDerived(float* values)
195-
{
196-
//
197-
// Fill event-wise derived quantities (these are all quantities which can be computed just based on the values already filled in the FillEvent() function)
198-
//
199-
if (fgUsedVars[kRunId]) {
200-
values[kRunId] = (fgRunMap.size() > 0 ? fgRunMap[static_cast<int>(values[kRunNo])] : 0);
201-
}
202-
}
128+
// void VarManager::FillEventDerived(float* values)
129+
// {
130+
// //
131+
// // Fill event-wise derived quantities (these are all quantities which can be computed just based on the values already filled in the FillEvent() function)
132+
// //
133+
// }
203134

204135
//__________________________________________________________________
205136
void VarManager::FillTrackDerived(float* values)
@@ -230,8 +161,6 @@ void VarManager::SetDefaultVarNames()
230161

231162
fgVariableNames[kRunNo] = "Run number";
232163
fgVariableUnits[kRunNo] = "";
233-
fgVariableNames[kRunId] = "Run number";
234-
fgVariableUnits[kRunId] = "";
235164
fgVariableNames[kBC] = "Bunch crossing";
236165
fgVariableUnits[kBC] = "";
237166
fgVariableNames[kTimeFromSOR] = "time since SOR";
@@ -1095,8 +1024,6 @@ void VarManager::SetDefaultVarNames()
10951024
// Set the variables short names map. This is needed for dynamic configuration via JSON files
10961025
fgVarNamesMap["kNothing"] = kNothing;
10971026
fgVarNamesMap["kRunNo"] = kRunNo;
1098-
fgVarNamesMap["kRunId"] = kRunId;
1099-
fgVarNamesMap["kRunIndex"] = kRunIndex;
11001027
fgVarNamesMap["kNRunWiseVariables"] = kNRunWiseVariables;
11011028
fgVarNamesMap["kTimestamp"] = kTimestamp;
11021029
fgVarNamesMap["kTimeFromSOR"] = kTimeFromSOR;

PWGDQ/Core/VarManager.h

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ class VarManager : public TObject
175175
kNothing = -1,
176176
// Run wise variables
177177
kRunNo = 0,
178-
kRunId,
179-
kRunIndex,
180178
kNRunWiseVariables,
181179

182180
// Event wise variables
@@ -898,29 +896,6 @@ class VarManager : public TObject
898896
return false;
899897
}
900898

901-
static void SetRunNumbers(int n, int* runs);
902-
static void SetRunNumbers(std::vector<int> runs);
903-
static float GetRunIndex(double);
904-
static void SetDummyRunlist(int InitRunnumber);
905-
static int GetDummyFirst();
906-
static int GetDummyLast();
907-
static int GetDummyNRuns()
908-
{
909-
if (fgRunMap.size() == 0) {
910-
return 101;
911-
} else {
912-
return fgRunMap.size();
913-
}
914-
}
915-
static int GetNRuns()
916-
{
917-
return fgRunMap.size();
918-
}
919-
static TString GetRunStr()
920-
{
921-
return fgRunStr;
922-
}
923-
924899
// Setup the collision system
925900
static void SetCollisionSystem(TString system, float energy);
926901

@@ -1159,9 +1134,6 @@ class VarManager : public TObject
11591134
static void SetVariableDependencies(); // toggle those variables on which other used variables might depend
11601135

11611136
static float fgMagField;
1162-
static std::map<int, int> fgRunMap; // map of runs to be used in histogram axes
1163-
static TString fgRunStr; // semi-colon separated list of runs, to be used for histogram axis labels
1164-
static std::vector<int> fgRunList; // vector of runs, to be used for histogram axis
11651137
static float fgCenterOfMassEnergy; // collision energy
11661138
static float fgMassofCollidingParticle; // mass of the colliding particle
11671139
static float fgTPCInterSectorBoundary; // TPC inter-sector border size at the TPC outer radius, in cm
@@ -1172,7 +1144,7 @@ class VarManager : public TObject
11721144
static uint64_t fgSOR; // Timestamp for start of run
11731145
static uint64_t fgEOR; // Timestamp for end of run
11741146

1175-
static void FillEventDerived(float* values = nullptr);
1147+
// static void FillEventDerived(float* values = nullptr);
11761148
static void FillTrackDerived(float* values = nullptr);
11771149
template <typename T, typename U, typename V>
11781150
static auto getRotatedCovMatrixXX(const T& matrix, U phi, V theta);
@@ -1442,7 +1414,6 @@ void VarManager::FillBC(T const& bc, float* values)
14421414
values[kBCOrbit] = bc.globalBC() % o2::constants::lhc::LHCMaxBunches;
14431415
values[kTimestamp] = bc.timestamp();
14441416
values[kTimeFromSOR] = (fgSOR > 0 ? (bc.timestamp() - fgSOR) / 60000. : -1.0);
1445-
values[kRunIndex] = GetRunIndex(bc.runNumber());
14461417
}
14471418

14481419
template <uint32_t fillMap, typename T>
@@ -1611,7 +1582,6 @@ void VarManager::FillEvent(T const& event, float* values)
16111582

16121583
if constexpr ((fillMap & ReducedEvent) > 0) {
16131584
values[kRunNo] = event.runNumber();
1614-
values[kRunIndex] = GetRunIndex(event.runNumber());
16151585
values[kVtxX] = event.posX();
16161586
values[kVtxY] = event.posY();
16171587
values[kVtxZ] = event.posZ();
@@ -1903,7 +1873,7 @@ void VarManager::FillEvent(T const& event, float* values)
19031873
FillZDC(event, values);
19041874
}
19051875

1906-
FillEventDerived(values);
1876+
// FillEventDerived(values);
19071877
}
19081878

19091879
template <uint32_t fillMap, typename TEvent, typename TAssoc, typename TTracks>

PWGDQ/TableProducer/tableMaker.cxx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ struct TableMaker {
206206
Configurable<bool> fConfigComputeTPCpostCalib{"cfgTPCpostCalib", false, "If true, compute TPC post-calibrated n-sigmas(electrons, pions, protons)"};
207207
Configurable<bool> fConfigComputeTPCpostCalibKaon{"cfgTPCpostCalibKaon", false, "If true, compute TPC post-calibrated n-sigmas for kaons"};
208208
Configurable<bool> fConfigIsOnlyforMaps{"cfgIsforMaps", false, "If true, run for postcalibration maps only"};
209-
Configurable<bool> fConfigDummyRunlist{"cfgDummyRunlist", false, "If true, use dummy runlist"};
210-
Configurable<int> fConfigInitRunNumber{"cfgInitRunNumber", 543215, "Initial run number used in run by run checks"};
211209
Configurable<bool> fPropMuon{"cfgPropMuon", false, "Propgate muon tracks through absorber"};
212210
Configurable<std::string> geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
213211
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
@@ -334,10 +332,6 @@ struct TableMaker {
334332
}
335333
}
336334

337-
if (fConfigDummyRunlist) {
338-
VarManager::SetDummyRunlist(fConfigInitRunNumber);
339-
}
340-
341335
DefineHistograms(histClasses); // define all histograms
342336
VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill
343337
fOutputList.setObject(fHistMan->GetMainHistogramList());
@@ -441,7 +435,6 @@ struct TableMaker {
441435
VarManager::fgValues[VarManager::kRunNo] = bc.runNumber();
442436
VarManager::fgValues[VarManager::kBC] = bc.globalBC();
443437
VarManager::fgValues[VarManager::kTimestamp] = bc.timestamp();
444-
VarManager::fgValues[VarManager::kRunIndex] = VarManager::GetRunIndex(bc.runNumber());
445438
VarManager::FillEvent<TEventFillMap>(collision); // extract event information and place it in the fValues array
446439
if (fDoDetailedQA) {
447440
fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues);
@@ -915,7 +908,6 @@ struct TableMaker {
915908
VarManager::fgValues[VarManager::kRunNo] = bc.runNumber();
916909
VarManager::fgValues[VarManager::kBC] = bc.globalBC();
917910
VarManager::fgValues[VarManager::kTimestamp] = bc.timestamp();
918-
VarManager::fgValues[VarManager::kRunIndex] = VarManager::GetRunIndex(bc.runNumber());
919911
VarManager::FillEvent<TEventFillMap>(collision); // extract event information and place it in the fValues array
920912
if (fDoDetailedQA) {
921913
fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues);

PWGDQ/TableProducer/tableMaker_withAssoc.cxx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,6 @@ struct TableMaker {
233233
Configurable<bool> fConfigComputeTPCpostCalibKaon{"cfgTPCpostCalibKaon", false, "If true, compute TPC post-calibrated n-sigmas for kaons"};
234234
Configurable<bool> fConfigIsOnlyforMaps{"cfgIsforMaps", false, "If true, run for postcalibration maps only"};
235235
Configurable<bool> fConfigSaveElectronSample{"cfgSaveElectronSample", false, "If true, only save electron sample"};
236-
Configurable<bool> fConfigDummyRunlist{"cfgDummyRunlist", false, "If true, use dummy runlist"};
237-
Configurable<int> fConfigInitRunNumber{"cfgInitRunNumber", 543215, "Initial run number used in run by run checks"};
238236
} fConfigPostCalibTPC;
239237

240238
struct : ConfigurableGroup {
@@ -397,10 +395,6 @@ struct TableMaker {
397395
}
398396
}
399397

400-
if (fConfigPostCalibTPC.fConfigDummyRunlist) {
401-
VarManager::SetDummyRunlist(fConfigPostCalibTPC.fConfigInitRunNumber);
402-
}
403-
404398
DefineHistograms(histClasses); // define all histograms
405399
// Additional histogram via the JSON configurable
406400
TString addHistsStr = fConfigHistOutput.fConfigAddJSONHistograms.value;

PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <map>
1919
#include <string>
2020
#include <memory>
21+
#include <utility>
2122
#include <TH1F.h>
2223
#include <TH3F.h>
2324
#include <THashList.h>
@@ -394,8 +395,6 @@ struct AnalysisTrackSelection {
394395
Configurable<int64_t> fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
395396
Configurable<bool> fConfigComputeTPCpostCalib{"cfgTPCpostCalib", false, "If true, compute TPC post-calibrated n-sigmas"};
396397
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
397-
Configurable<bool> fConfigDummyRunlist{"cfgDummyRunlist", false, "If true, use dummy runlist"};
398-
Configurable<int> fConfigInitRunNumber{"cfgInitRunNumber", 543215, "Initial run number used in run by run checks"};
399398

400399
Configurable<std::string> fConfigMCSignals{"cfgTrackMCSignals", "", "Comma separated list of MC signals"};
401400
Configurable<std::string> fConfigMCSignalsJSON{"cfgTrackMCsignalsJSON", "", "Additional list of MC signals via JSON"};
@@ -433,7 +432,7 @@ struct AnalysisTrackSelection {
433432
if (addTrackCutsStr != "") {
434433
std::vector<AnalysisCut*> addTrackCuts = dqcuts::GetCutsFromJSON(addTrackCutsStr.Data());
435434
for (auto& t : addTrackCuts) {
436-
fTrackCuts.push_back((AnalysisCompositeCut*)t);
435+
fTrackCuts.push_back(reinterpret_cast<AnalysisCompositeCut*>(t));
437436
}
438437
}
439438
VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill
@@ -493,9 +492,6 @@ struct AnalysisTrackSelection {
493492
fOutputList.setObject(fHistMan->GetMainHistogramList());
494493
}
495494

496-
if (fConfigDummyRunlist) {
497-
VarManager::SetDummyRunlist(fConfigInitRunNumber);
498-
}
499495
if (fConfigComputeTPCpostCalib) {
500496
fCCDB->setURL(fConfigCcdbUrl.value);
501497
fCCDB->setCaching(true);
@@ -760,7 +756,7 @@ struct AnalysisMuonSelection {
760756
if (addCutsStr != "") {
761757
std::vector<AnalysisCut*> addCuts = dqcuts::GetCutsFromJSON(addCutsStr.Data());
762758
for (auto& t : addCuts) {
763-
fMuonCuts.push_back((AnalysisCompositeCut*)t);
759+
fMuonCuts.push_back(reinterpret_cast<AnalysisCompositeCut*>(t));
764760
}
765761
}
766762
VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill
@@ -2203,7 +2199,7 @@ struct AnalysisAsymmetricPairing {
22032199
if (addPairCutsStr != "") {
22042200
std::vector<AnalysisCut*> addPairCuts = dqcuts::GetCutsFromJSON(addPairCutsStr.Data());
22052201
for (auto& t : addPairCuts) {
2206-
fPairCuts.push_back((AnalysisCompositeCut*)t);
2202+
fPairCuts.push_back(reinterpret_cast<AnalysisCompositeCut*>(t));
22072203
cutNamesStr += Form(",%s", t->GetName());
22082204
}
22092205
}
@@ -3290,7 +3286,7 @@ struct AnalysisDileptonTrack {
32903286
// loop over all the upstream cuts and make a bit mask for the track cuts specified in this task
32913287
for (int icut = 0; icut < cfgTrackSelection_objArrayTrackCuts->GetEntries(); icut++) {
32923288
if (cfgDileptonTrack_objArrayTrackCuts->FindObject(cfgTrackSelection_objArrayTrackCuts->At(icut)->GetName())) {
3293-
fTrackCutBitMap |= (uint32_t(1) << icut);
3289+
fTrackCutBitMap |= (static_cast<uint32_t>(1) << icut);
32943290
}
32953291
}
32963292
// finally, store the total number of upstream tasks, for easy access
@@ -3358,7 +3354,7 @@ struct AnalysisDileptonTrack {
33583354
for (int iCutTrack = 0; iCutTrack < fNCuts; iCutTrack++) {
33593355

33603356
// here we check that this track cut is one of those required to associate with the dileptons
3361-
if (!(fTrackCutBitMap & (uint32_t(1) << iCutTrack))) {
3357+
if (!(fTrackCutBitMap & (static_cast<uint32_t>(1) << iCutTrack))) {
33623358
continue;
33633359
}
33643360

@@ -3593,13 +3589,13 @@ struct AnalysisDileptonTrack {
35933589
// loop over specified track cuts (the tracks to be combined with the dileptons)
35943590
for (int iTrackCut = 0; iTrackCut < fNCuts; iTrackCut++) {
35953591

3596-
if (!(trackSelection & (uint32_t(1) << iTrackCut))) {
3592+
if (!(trackSelection & (static_cast<uint32_t>(1) << iTrackCut))) {
35973593
continue;
35983594
}
35993595

36003596
fHistMan->FillHistClass(Form("DileptonTrack_%s_%s", fTrackCutNames[icut].Data(), fTrackCutNames[iTrackCut].Data()), fValuesHadron);
36013597
for (uint32_t isig = 0; isig < fRecMCSignals.size(); isig++) {
3602-
if (mcDecision & (uint32_t(1) << isig)) {
3598+
if (mcDecision & (static_cast<uint32_t>(1) << isig)) {
36033599
fHistMan->FillHistClass(Form("DileptonTrackMCMatched_%s_%s_%s", fTrackCutNames[icut].Data(), fTrackCutNames[iTrackCut].Data(), fRecMCSignals[isig]->GetName()), fValuesHadron);
36043600
}
36053601
}
@@ -3609,7 +3605,7 @@ struct AnalysisDileptonTrack {
36093605
if (dilepton.commonFilterMap_bit(fCommonTrackCutMap[iCommonCut])) {
36103606
fHistMan->FillHistClass(Form("DileptonTrack_%s_%s_%s", fTrackCutNames[icut].Data(), fCommonPairCutNames[iCommonCut].Data(), fTrackCutNames[iTrackCut].Data()), fValuesHadron);
36113607
for (uint32_t isig = 0; isig < fRecMCSignals.size(); isig++) {
3612-
if (mcDecision & (uint32_t(1) << isig)) {
3608+
if (mcDecision & (static_cast<uint32_t>(1) << isig)) {
36133609
fHistMan->FillHistClass(Form("DileptonTrackMCMatched_%s_%s_%s_%s", fTrackCutNames[icut].Data(), fCommonPairCutNames[iCommonCut].Data(), fTrackCutNames[iTrackCut].Data(), fRecMCSignals[isig]->GetName()), fValuesHadron);
36143610
}
36153611
}
@@ -3619,15 +3615,15 @@ struct AnalysisDileptonTrack {
36193615
if (dilepton.pairFilterMap_bit(iPairCut)) {
36203616
fHistMan->FillHistClass(Form("DileptonTrack_%s_%s_%s", fTrackCutNames[icut].Data(), fPairCutNames[iPairCut].Data(), fTrackCutNames[iTrackCut].Data()), fValuesHadron);
36213617
for (uint32_t isig = 0; isig < fRecMCSignals.size(); isig++) {
3622-
if (mcDecision & (uint32_t(1) << isig)) {
3618+
if (mcDecision & (static_cast<uint32_t>(1) << isig)) {
36233619
fHistMan->FillHistClass(Form("DileptonTrackMCMatched_%s_%s_%s_%s", fTrackCutNames[icut].Data(), fPairCutNames[iPairCut].Data(), fTrackCutNames[iTrackCut].Data(), fRecMCSignals[isig]->GetName()), fValuesHadron);
36243620
}
36253621
}
36263622
for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; iCommonCut++) {
36273623
if (dilepton.commonFilterMap_bit(fCommonTrackCutMap[iCommonCut])) {
36283624
fHistMan->FillHistClass(Form("DileptonTrack_%s_%s_%s_%s", fTrackCutNames[icut].Data(), fCommonPairCutNames[iCommonCut].Data(), fPairCutNames[iPairCut].Data(), fTrackCutNames[iTrackCut].Data()), fValuesHadron);
36293625
for (uint32_t isig = 0; isig < fRecMCSignals.size(); isig++) {
3630-
if (mcDecision & (uint32_t(1) << isig)) {
3626+
if (mcDecision & (static_cast<uint32_t>(1) << isig)) {
36313627
fHistMan->FillHistClass(Form("DileptonTrackMCMatched_%s_%s_%s_%s_%s", fTrackCutNames[icut].Data(), fCommonPairCutNames[iCommonCut].Data(), fPairCutNames[iPairCut].Data(), fTrackCutNames[iTrackCut].Data(), fRecMCSignals[isig]->GetName()), fValuesHadron);
36323628
}
36333629
}

0 commit comments

Comments
 (0)