Skip to content

Commit 9bed27a

Browse files
committed
Initialize variables
1 parent 0d28c60 commit 9bed27a

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,14 @@ struct AnalysisEventSelection {
331331

332332
HistogramManager* fHistMan = nullptr;
333333

334-
AnalysisCompositeCut* fEventCut;
334+
AnalysisCompositeCut* fEventCut = nullptr;
335335

336-
Service<o2::ccdb::BasicCCDBManager> fCCDB;
336+
Service<o2::ccdb::BasicCCDBManager> fCCDB{};
337337
o2::ccdb::CcdbApi fCCDBApi;
338338

339339
std::map<int64_t, bool> fSelMap; // key: reduced event global index, value: event selection decision
340340
std::map<uint64_t, std::vector<int64_t>> fBCCollMap; // key: global BC, value: vector of reduced event global indices
341-
int fCurrentRun;
341+
int fCurrentRun = -1;
342342

343343
void init(o2::framework::InitContext& context)
344344
{
@@ -592,16 +592,16 @@ struct AnalysisTrackSelection {
592592
Configurable<std::string> fConfigMCSignals{"cfgTrackMCSignals", "", "Comma separated list of MC signals"};
593593
Configurable<std::string> fConfigMCSignalsJSON{"cfgTrackMCsignalsJSON", "", "Additional list of MC signals via JSON"};
594594

595-
Service<o2::ccdb::BasicCCDBManager> fCCDB;
596-
Service<o2::pid::tof::TOFResponse> fTofResponse;
595+
Service<o2::ccdb::BasicCCDBManager> fCCDB{};
596+
Service<o2::pid::tof::TOFResponse> fTofResponse{};
597597

598-
HistogramManager* fHistMan;
598+
HistogramManager* fHistMan = nullptr;
599599
std::vector<AnalysisCompositeCut*> fTrackCuts;
600600
std::vector<MCSignal*> fMCSignals; // list of signals to be checked
601601
std::vector<TString> fHistNamesReco;
602602
std::vector<TString> fHistNamesMCMatched;
603603

604-
int fCurrentRun; // current run (needed to detect run changes for loading CCDB parameters)
604+
int fCurrentRun = 0; // current run (needed to detect run changes for loading CCDB parameters)
605605

606606
std::map<int64_t, std::vector<int64_t>> fNAssocsInBunch; // key: track global index, value: vector of global index for events associated in-bunch (events that have in-bunch pileup or splitting)
607607
std::map<int64_t, std::vector<int64_t>> fNAssocsOutOfBunch; // key: track global index, value: vector of global index for events associated out-of-bunch (events that have no in-bunch pileup)
@@ -938,9 +938,9 @@ struct AnalysisPrefilterSelection {
938938
Configurable<bool> fPropTrack{"cfgPropTrack", false, "Propagate tracks to associated collision to recalculate DCA and momentum vector"};
939939

940940
std::map<uint32_t, uint32_t> fPrefilterMap;
941-
AnalysisCompositeCut* fPairCut;
942-
uint32_t fPrefilterMask;
943-
int fPrefilterCutBit;
941+
AnalysisCompositeCut* fPairCut = nullptr;
942+
uint32_t fPrefilterMask = 0;
943+
int fPrefilterCutBit = -1;
944944

945945
Preslice<aod::TrackAssoc> trackAssocsPerCollision = aod::track_association::collisionId;
946946

@@ -1131,7 +1131,7 @@ struct AnalysisSameEventPairing {
11311131
Produces<aod::OniaMCTruth> MCTruthTableEffi;
11321132

11331133
o2::base::MatLayerCylSet* fLUT = nullptr;
1134-
int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc.
1134+
int fCurrentRun = 0; // needed to detect if the run changed and trigger update of calibrations etc.
11351135

11361136
OutputObj<THashList> fOutputList{"output"};
11371137

@@ -1178,11 +1178,11 @@ struct AnalysisSameEventPairing {
11781178
Configurable<std::string> geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
11791179
} fConfigCCDB;
11801180

1181-
Service<o2::ccdb::BasicCCDBManager> fCCDB;
1181+
Service<o2::ccdb::BasicCCDBManager> fCCDB{};
11821182
// PDG database
1183-
Service<o2::framework::O2DatabasePDG> pdgDB;
1183+
Service<o2::framework::O2DatabasePDG> pdgDB{};
11841184

1185-
HistogramManager* fHistMan;
1185+
HistogramManager* fHistMan = nullptr;
11861186

11871187
// vectors needed for PV recomputation
11881188
std::vector<int64_t> pvContribGlobIDs;
@@ -1202,14 +1202,14 @@ struct AnalysisSameEventPairing {
12021202
std::vector<AnalysisCut*> fMCGenAccCuts;
12031203
bool fUseMCGenAccCut = false;
12041204

1205-
uint32_t fTrackFilterMask; // mask for the track cuts required in this task to be applied on the barrel cuts produced upstream
1206-
uint32_t fMuonFilterMask; // mask for the muon cuts required in this task to be applied on the muon cuts produced upstream
1207-
int fNCutsBarrel;
1208-
int fNCutsMuon;
1209-
int fNPairCuts;
1205+
uint32_t fTrackFilterMask = 0; // mask for the track cuts required in this task to be applied on the barrel cuts produced upstream
1206+
uint32_t fMuonFilterMask = 0; // mask for the muon cuts required in this task to be applied on the muon cuts produced upstream
1207+
int fNCutsBarrel = 0;
1208+
int fNCutsMuon = 0;
1209+
int fNPairCuts = 0;
12101210
bool fHasTwoProngGenMCsignals = false;
12111211

1212-
bool fEnableBarrelHistos;
1212+
bool fEnableBarrelHistos = false;
12131213
// bool fEnableMuonHistos;
12141214

12151215
Preslice<soa::Join<aod::TrackAssoc, aod::BarrelTrackCuts, aod::Prefilter>> trackAssocsPerCollision = aod::track_association::collisionId;
@@ -2285,21 +2285,21 @@ struct AnalysisDileptonTrack {
22852285
Configurable<std::string> fConfigMCGenSignalHadronJSON{"cfgMCGenSignalHadronJSON", "", "generator level hadron signal (JSON format), used for MC level combinatorics"};
22862286
} fConfigMCOptions;
22872287

2288-
int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc.
2289-
int fNCuts;
2290-
int fNLegCuts;
2291-
int fNPairCuts;
2292-
int fNCommonTrackCuts;
2288+
int fCurrentRun = 0; // needed to detect if the run changed and trigger update of calibrations etc.
2289+
int fNCuts = 0;
2290+
int fNLegCuts = 0;
2291+
int fNPairCuts = 0;
2292+
int fNCommonTrackCuts = 0;
22932293
std::map<int, int> fCommonTrackCutMap;
2294-
uint32_t fTrackCutBitMap; // track cut bit mask to be used in the selection of tracks associated with dileptons
2294+
uint32_t fTrackCutBitMap = 0; // track cut bit mask to be used in the selection of tracks associated with dileptons
22952295
// vector for single-lepton and track cut names for easy access when calling FillHistogramList()
22962296
std::vector<TString> fTrackCutNames;
22972297
std::vector<TString> fLegCutNames;
22982298
// vector for pair cut names, used mainly for pairs built via the asymmetric pairing task
22992299
std::vector<TString> fPairCutNames;
23002300
std::vector<TString> fCommonPairCutNames;
23012301

2302-
Service<o2::ccdb::BasicCCDBManager> fCCDB;
2302+
Service<o2::ccdb::BasicCCDBManager> fCCDB{};
23032303

23042304
// TODO: The filter expressions seem to always use the default value of configurables, not the values from the actual configuration file
23052305
Filter eventFilter = aod::dqanalysisflags::isEventSelected > static_cast<uint32_t>(0);
@@ -2308,14 +2308,14 @@ struct AnalysisDileptonTrack {
23082308
// Filter filterMuon = aod::dqanalysisflags::isMuonSelected > static_cast<uint32_t>(0);
23092309

23102310
// use two values array to avoid mixing up the quantities
2311-
float* fValuesDilepton;
2312-
float* fValuesHadron;
2313-
HistogramManager* fHistMan;
2311+
float* fValuesDilepton = nullptr;
2312+
float* fValuesHadron = nullptr;
2313+
HistogramManager* fHistMan = nullptr;
23142314

23152315
std::vector<MCSignal*> fRecMCSignals;
23162316
std::vector<MCSignal*> fGenMCSignals;
2317-
MCSignal* fDileptonLegSignal;
2318-
MCSignal* fHadronSignal;
2317+
MCSignal* fDileptonLegSignal = nullptr;
2318+
MCSignal* fHadronSignal = nullptr;
23192319

23202320
void init(o2::framework::InitContext& context)
23212321
{

0 commit comments

Comments
 (0)