Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EventFiltering/PWGHF/HFFilterHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ inline void HfFilterHelper::setTpcRecalibMaps(o2::framework::Service<o2::ccdb::B

for (size_t iMap = 0; iMap < mapNames.size(); iMap++) {

mHistMapPiPrKaDe[iMap] = reinterpret_cast<TH3F*>(calibList->FindObject(mapNames[iMap].data()));
mHistMapPiPrKaDe[iMap] = dynamic_cast<TH3F*>(calibList->FindObject(mapNames[iMap].data()));
if (!mHistMapPiPrKaDe[iMap]) {
LOG(fatal) << "Cannot find histogram: " << mapNames[iMap].data();
return;
Expand Down
2 changes: 1 addition & 1 deletion EventFiltering/PWGJE/jetFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct jetFilter {
void init(o2::framework::InitContext&)
{
triggerJetR = TMath::Nint(cfgJetR * 100.0f);
trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast<std::string>(trackSelections));
trackSelection = jetderiveddatautilities::initialiseTrackSelection(trackSelections);
eventSelectionBits = jetderiveddatautilities::initialiseEventSelectionBits(static_cast<std::string>(evSel));

spectra.add("fCollZpos", "collision z position", HistType::kTH1F,
Expand Down
18 changes: 9 additions & 9 deletions EventFiltering/PWGUD/diffractionBCFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ struct tracksWGTInBCs {
LOGF(debug, " Number of BCs %d", atr.bc().size());
if (atr.bc().size() > 0) {
auto firstCompatibleBC = atr.bc().begin().globalBC();
closestBC = (uint64_t)(firstCompatibleBC +
(track.trackTime() / o2::constants::lhc::LHCBunchSpacingNS));
closestBC = static_cast<uint64_t>(firstCompatibleBC +
(track.trackTime() / o2::constants::lhc::LHCBunchSpacingNS));
// update tracksInBCList
LOGF(debug, "closestBC %d", closestBC);
tracksInBCList[closestBC].emplace_back((int32_t)track.globalIndex());
tracksInBCList[closestBC].emplace_back(static_cast<int32_t>(track.globalIndex()));
}
} else {
// registry.get<TH1>(HIST("barrelTracks"))->Fill(2., 1.);
Expand All @@ -128,7 +128,7 @@ struct tracksWGTInBCs {

// update tracksInBCList
LOGF(debug, "closestBC %d", closestBC);
tracksInBCList[closestBC].emplace_back((int32_t)track.globalIndex());
tracksInBCList[closestBC].emplace_back(static_cast<int32_t>(track.globalIndex()));
}
}
LOGF(debug, "track finished.\n");
Expand Down Expand Up @@ -195,12 +195,12 @@ struct tracksWGTInBCs {
LOGF(debug, " Number of BCs %d", aftr.bc().size());
if (aftr.bc().size() > 0) {
auto firstCompatibleBC = aftr.bc().begin().globalBC();
closestBC = (uint64_t)(firstCompatibleBC +
(fwdTrack.trackTime() / o2::constants::lhc::LHCBunchSpacingNS));
closestBC = static_cast<uint64_t>(firstCompatibleBC +
(fwdTrack.trackTime() / o2::constants::lhc::LHCBunchSpacingNS));

// update fwdTracksWGTInBCList
LOGF(debug, "closestBC %d", closestBC);
fwdTracksWGTInBCList[closestBC].emplace_back((int32_t)fwdTrack.globalIndex());
fwdTracksWGTInBCList[closestBC].emplace_back(static_cast<int32_t>(fwdTrack.globalIndex()));
}
} else {
// registry.get<TH1>(HIST("forwardTracks"))->Fill(2., 1.);
Expand All @@ -212,7 +212,7 @@ struct tracksWGTInBCs {

// update fwdTracksWGTInBCList
LOGF(debug, "closestBC %d", closestBC);
fwdTracksWGTInBCList[closestBC].emplace_back((int32_t)fwdTrack.globalIndex());
fwdTracksWGTInBCList[closestBC].emplace_back(static_cast<int32_t>(fwdTrack.globalIndex()));
}
}
LOGF(debug, "FwdTrack finished.\n");
Expand Down Expand Up @@ -282,7 +282,7 @@ struct DGBCFilterRun3 {

void init(InitContext&)
{
diffCuts = (DGCutparHolder)DGCuts;
diffCuts = DGCutparHolder(DGCuts);
}

// some general Collisions and Tracks filter
Expand Down
4 changes: 2 additions & 2 deletions EventFiltering/PWGUD/diffractionFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ struct DGFilterRun3 {
{
// reset collision counter
collCounter = 0;
verbose = (int64_t)Verbose;
verbose = static_cast<int64_t>(Verbose);
if (verbose <= 0) {
verbose = 1000000000000;
}

// cut holder
diffCuts = (DGCutparHolder)diffCutsHolder;
diffCuts = DGCutparHolder(diffCutsHolder);

// create histograms
// stat
Expand Down
10 changes: 5 additions & 5 deletions EventFiltering/macros/cefpOutputChecker.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
void cefpOutputChecker(std::string histoFile = "AnalysisResults.root", std::string treeFile = "AO2D.root")
{
TFile referenceFile(histoFile.data());
TH1* refScalers = (TH1*)referenceFile.Get("central-event-filter-task/scalers/mScalers");
TH1* refFilters = (TH1*)referenceFile.Get("central-event-filter-task/scalers/mFiltered");
TH1* refScalers = dynamic_cast<TH1*>(referenceFile.Get("central-event-filter-task/scalers/mScalers"));
TH1* refFilters = dynamic_cast<TH1*>(referenceFile.Get("central-event-filter-task/scalers/mFiltered"));

TFile outputFile("cefpOutputChecker.root", "recreate");
TH1* newFilters = (TH1*)refFilters->Clone("newFilters");
TH1* newScalers = (TH1*)refScalers->Clone("newScalers");
TH1* newFilters = dynamic_cast<TH1*>(refFilters->Clone("newFilters"));
TH1* newScalers = dynamic_cast<TH1*>(refScalers->Clone("newScalers"));
newFilters->Reset();
newScalers->Reset();

TFile inputFile(treeFile.data());
for (auto key : *(inputFile.GetListOfKeys())) {
TTree* cefpTree = (TTree*)inputFile.Get(Form("%s/O2cefpdecision", key->GetName()));
TTree* cefpTree = dynamic_cast<TTree*>(inputFile.Get(Form("%s/O2cefpdecision", key->GetName())));
if (!cefpTree)
continue;
ULong64_t fCefpSelected, fCefpTriggered;
Expand Down
14 changes: 7 additions & 7 deletions EventFiltering/macros/checkBCrangesSkimming.C
Original file line number Diff line number Diff line change
Expand Up @@ -620,28 +620,28 @@ void checkBCrangesSkimming(std::string AnaFileName = "AnalysisResults.root", std
TH1D *hOriginalSinglesRatio, *hOriginalDoublesRatio, *hOriginalMultiplesRatio;
TH1D *hSkimmedSinglesRatio, *hSkimmedDoublesRatio, *hSkimmedMultiplesRatio;

hTriggerEff = reinterpret_cast<TH1D*>(hSkimmedTotal.Clone("hTriggerEff"));
hTriggerEff = dynamic_cast<TH1D*>(hSkimmedTotal.Clone("hTriggerEff"));
hTriggerEff->SetTitle((runNumber + " skimmed efficiency;; Skimmed / Original").data());
hTriggerEff->Divide(&hOriginalTotal);
hTriggerMatchesRatio.Divide(&hOriginalSingles);
hTriggerSingleMatchesRatio.Divide(&hOriginalSingles);
hOriginalSinglesRatio = reinterpret_cast<TH1D*>(hOriginalSingles.Clone("hOriginalSinglesRatio"));
hOriginalSinglesRatio = dynamic_cast<TH1D*>(hOriginalSingles.Clone("hOriginalSinglesRatio"));
hOriginalSinglesRatio->SetTitle((runNumber + " Original;;Singles / Total").data());
hOriginalSinglesRatio->Divide(&hOriginalTotal);
hOriginalDoublesRatio = reinterpret_cast<TH1D*>(hOriginalDoubles.Clone("hOriginalDoublesRatio"));
hOriginalDoublesRatio = dynamic_cast<TH1D*>(hOriginalDoubles.Clone("hOriginalDoublesRatio"));
hOriginalDoublesRatio->SetTitle((runNumber + " Original;;Doubles / Total").data());
hOriginalDoublesRatio->Divide(&hOriginalTotal);
hOriginalMultiplesRatio = reinterpret_cast<TH1D*>(hOriginalMultiples.Clone("hOriginalMultiplesRatio"));
hOriginalMultiplesRatio = dynamic_cast<TH1D*>(hOriginalMultiples.Clone("hOriginalMultiplesRatio"));
hOriginalMultiplesRatio->SetTitle((runNumber + " Original;;Multiples / Total").data());
hOriginalMultiplesRatio->Divide(&hOriginalTotal);

hSkimmedSinglesRatio = reinterpret_cast<TH1D*>(hSkimmedSingles.Clone("hSkimmedSinglesRatio"));
hSkimmedSinglesRatio = dynamic_cast<TH1D*>(hSkimmedSingles.Clone("hSkimmedSinglesRatio"));
hSkimmedSinglesRatio->SetTitle((runNumber + " Skimmed;;Singles / Total").data());
hSkimmedSinglesRatio->Divide(&hSkimmedTotal);
hSkimmedDoublesRatio = reinterpret_cast<TH1D*>(hSkimmedDoubles.Clone("hSkimmedDoublesRatio"));
hSkimmedDoublesRatio = dynamic_cast<TH1D*>(hSkimmedDoubles.Clone("hSkimmedDoublesRatio"));
hSkimmedDoublesRatio->SetTitle((runNumber + " Skimmed;;Doubles / Total").data());
hSkimmedDoublesRatio->Divide(&hSkimmedTotal);
hSkimmedMultiplesRatio = reinterpret_cast<TH1D*>(hSkimmedMultiples.Clone("hSkimmedMultiplesRatio"));
hSkimmedMultiplesRatio = dynamic_cast<TH1D*>(hSkimmedMultiples.Clone("hSkimmedMultiplesRatio"));
hSkimmedMultiplesRatio->SetTitle((runNumber + " Skimmed;;Multiples / Total").data());
hSkimmedMultiplesRatio->Divide(&hSkimmedTotal);

Expand Down
2 changes: 1 addition & 1 deletion EventFiltering/macros/checkSkimming.C
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void checkSkimming(const std::string& listName = "period.txt", bool skipDownscal
std::string original_path = line.substr(0, pos);
std::string skimmed_path = line.substr(pos + 1);
checkSkimming(original_path, skimmed_path, outputFile, skipDownscaled);
TH1* hRatio = (TH1*)gDirectory->Get("hRatio");
TH1* hRatio = dynamic_cast<TH1*>(gDirectory->Get("hRatio"));
hRatio->Draw();
std::string suffix = counter == 0 ? "(" : (counter == lineCounter - 1 ? ")" : "");
c1.Print((periodName + ".pdf" + suffix).data());
Expand Down
2 changes: 1 addition & 1 deletion EventFiltering/macros/getMenu.C
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ std::vector<std::string> getMenuForPeriod(std::string period)

TGrid::Connect("alien://");
TFile* scalersFile = TFile::Open((std::string("alien://") + firstLine).data(), "READ");
TH1D* counters = (TH1D*)scalersFile->Get("central-event-filter-task/scalers/mFiltered");
TH1D* counters = dynamic_cast<TH1D*>(scalersFile->Get("central-event-filter-task/scalers/mFiltered"));
TAxis* axis = counters->GetXaxis();

std::vector<std::string> binLabels(axis->GetNbins() - 2);
Expand Down
2 changes: 1 addition & 1 deletion EventFiltering/macros/selectivityPlot.C
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void selectivityPlot(int runNumber = 550781, const TString& inputfile = "Analysi
Canvas_1->SetFrameBorderMode(0);

TFile* file = new TFile(inputfile.Data());
TH1D* mFiltered = (TH1D*)file->Get("central-event-filter-task/scalers/mFiltered");
TH1D* mFiltered = dynamic_cast<TH1D*>(file->Get("central-event-filter-task/scalers/mFiltered"));
double nEvents = mFiltered->GetBinContent(1);
mFiltered->Scale(1. / nEvents);
mFiltered->SetLineColor(2);
Expand Down
14 changes: 7 additions & 7 deletions EventFiltering/macros/uploadOTSobjects.C
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ void uploadOTSobjects(std::string inputList, const std::string& passName, bool u
auto orbitResetTimestamp = (*ctp)[0];
path = useAlien ? "alien://" + path : path;
std::unique_ptr<TFile> scalersFile{TFile::Open((path + "/AnalysisResults_fullrun.root").data(), "READ")};
TH1* scalers = static_cast<TH1*>(scalersFile->Get("central-event-filter-task/scalers/mScalers"));
TH1* filters = static_cast<TH1*>(scalersFile->Get("central-event-filter-task/scalers/mFiltered"));
TH1* scalers = dynamic_cast<TH1*>(scalersFile->Get("central-event-filter-task/scalers/mScalers"));
TH1* filters = dynamic_cast<TH1*>(scalersFile->Get("central-event-filter-task/scalers/mFiltered"));
api.storeAsTFile(scalers, baseCCDBpath + "FilterCounters", metadata, duration.first, duration.second + 1);
api.storeAsTFile(filters, baseCCDBpath + "SelectionCounters", metadata, duration.first, duration.second + 1);
TH1* hCounterTVX = static_cast<TH1*>(scalersFile->Get("bc-selection-task/hCounterTVX"));
TH1* hCounterTVX = dynamic_cast<TH1*>(scalersFile->Get("bc-selection-task/hCounterTVX"));
if (!hCounterTVX) {
hCounterTVX = static_cast<TH1*>(scalersFile->Get("lumi-task/hCounterTVX"));
hCounterTVX = dynamic_cast<TH1*>(scalersFile->Get("lumi-task/hCounterTVX"));
if (!hCounterTVX) {
hCounterTVX = static_cast<TH1*>(scalersFile->Get("eventselection-run3/luminosity/hCounterTVX"));
hCounterTVX = dynamic_cast<TH1*>(scalersFile->Get("eventselection-run3/luminosity/hCounterTVX"));
if (!hCounterTVX) {
std::cout << "No hCounterTVX histogram found in the file, skipping upload for run " << runString << std::endl;
continue;
Expand All @@ -88,7 +88,7 @@ void uploadOTSobjects(std::string inputList, const std::string& passName, bool u
std::unique_ptr<TFile> bcRangesFile{TFile::Open((path + "/bcRanges_fullrun.root").data(), "READ")};
int Nmax = 0;
for (auto key : *(bcRangesFile->GetListOfKeys())) {
TTree* cefpTree = static_cast<TTree*>(bcRangesFile->Get(Form("%s/selectedBC", key->GetName())));
TTree* cefpTree = dynamic_cast<TTree*>(bcRangesFile->Get(Form("%s/selectedBC", key->GetName())));
if (!cefpTree)
continue;
ZorroHelper bci;
Expand Down Expand Up @@ -134,7 +134,7 @@ void uploadOTSobjects(std::string inputList, const std::string& passName, bool u
auto bcNext{nextHelper.bcAOD < nextHelper.bcEvSel ? nextHelper.bcAOD : nextHelper.bcEvSel};
if (bcNext - bcEnd > 2001 / o2::constants::lhc::LHCBunchSpacingMUS) { /// ensure a gap of 2ms between chunks
chunk.insert(chunk.begin(), zorroHelpers.begin() + helperIndex, zorroHelpers.begin() + endIndex + 1);
endTS = (orbitResetTimestamp + int64_t(bcEnd * o2::constants::lhc::LHCBunchSpacingNS * 1e-3)) / 1000 + 1;
endTS = (orbitResetTimestamp + static_cast<int64_t>(bcEnd * o2::constants::lhc::LHCBunchSpacingNS * 1e-3)) / 1000 + 1;
break;
}
bcEnd = nextHelper.bcAOD > nextHelper.bcEvSel ? nextHelper.bcAOD : nextHelper.bcEvSel;
Expand Down
Loading