Skip to content

Commit 3890e78

Browse files
committed
Adjust macros to new naming defaults
1 parent edea0ab commit 3890e78

19 files changed

Lines changed: 42 additions & 24 deletions

File tree

Detectors/CPV/testsimulation/plot_hit_cpv.C

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@
1414
#include "SimulationDataFormat/MCCompLabel.h"
1515
#include "CPVBase/Geometry.h"
1616
#include "CPVBase/Hit.h"
17+
#include "DetectorsCommonDataFormats/NameConf.h"
18+
#include "DetectorsCommonDataFormats/DetID.h"
1719
#endif
1820

19-
void plot_hit_cpv(int ievent = 0, std::string inputfile = "o2sim.root")
21+
using namespace o2::detectors;
22+
23+
void plot_hit_cpv(int ievent = 0, std::string inputprefix = "o2sim")
2024
{
2125
// macros to plot CPV hits
2226

2327
// Hits
24-
TFile* file0 = TFile::Open("o2sim.root");
28+
std::string inputfile(o2::base::NameConf::getHitsFileName(DetID::CPV, inputprefix));
29+
TFile* file0 = TFile::Open(inputfile.c_str());
2530
std::cout << " Open hits file " << inputfile << std::endl;
2631
TTree* hitTree = (TTree*)gFile->Get("o2sim");
2732
std::vector<o2::cpv::Hit>* mHitsArray = nullptr;

Detectors/FIT/FV0/macro/readFV0Hits.C

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <sstream>
2020
#include "DataFormatsFV0/Hit.h"
2121
#include "FairLogger.h"
22+
#include "DetectorsCommonDataFormats/NameConf.h"
23+
#include "DetectorsCommonDataFormats/DetID.h"
2224

2325
void AdjustStatBox(TH1* h, float x1ndc, float x2ndc, float y1ndc, float y2ndc)
2426
{
@@ -61,8 +63,10 @@ void InitHistoNames(std::vector<std::string>& vhName, std::vector<int>& vPdg)
6163
}
6264
}
6365

64-
void readFV0Hits(std::string simFName = "o2sim.root", UInt_t rebin = 1)
66+
void readFV0Hits(std::string simPrefix = "o2sim", UInt_t rebin = 1)
6567
{
68+
using namespace o2::detectors;
69+
std::string simFName(o2::base::NameConf::getHitsFileName(DetID::FV0, simPrefix));
6670
gStyle->SetOptStat("noumri");
6771
const int nCells = 40;
6872

Detectors/FIT/macros/readFT0hits.C

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <TFile.h>
66
#include <TH2F.h>
77
#include <TTree.h>
8+
#include "DetectorsCommonDataFormats/DetID.h"
9+
#include "DetectorsCommonDataFormats/NameConf.h"
810

911
void readFT0hits()
1012
{
@@ -25,7 +27,8 @@ void readFT0hits()
2527

2628
gDirectory = cwd;
2729

28-
TFile* fhit = new TFile("o2sim.root");
30+
using namespace o2::detectors;
31+
TFile* fhit = new TFile(o2::base::NameConf::getHitsFileName(DetID::FT0, "o2sim").c_str());
2932
TTree* hitTree = (TTree*)fhit->Get("o2sim");
3033

3134
o2::dataformats::MCEventHeader* mcHeader = nullptr;

Detectors/ITSMFT/ITS/macros/test/CheckClusters.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "SimulationDataFormat/MCTruthContainer.h"
2121
#endif
2222

23-
void CheckClusters(std::string clusfile = "o2clus_its.root", std::string hitfile = "o2sim.root", std::string inputGeom = "O2geometry.root", std::string paramfile = "o2sim_par.root")
23+
void CheckClusters(std::string clusfile = "o2clus_its.root", std::string hitfile = "o2sim_HitsITS.root", std::string inputGeom = "O2geometry.root", std::string paramfile = "o2sim_par.root")
2424
{
2525
const int QEDSourceID = 99; // Clusters from this MC source correspond to QED electrons
2626

Detectors/ITSMFT/ITS/macros/test/CheckDigits.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#endif
2525

26-
void CheckDigits(std::string digifile = "itsdigits.root", std::string hitfile = "o2sim.root", std::string inputGeom = "O2geometry.root", std::string paramfile = "o2sim_par.root")
26+
void CheckDigits(std::string digifile = "itsdigits.root", std::string hitfile = "o2sim_HitsITS.root", std::string inputGeom = "O2geometry.root", std::string paramfile = "o2sim_par.root")
2727
{
2828

2929
using namespace o2::base;

Detectors/ITSMFT/ITS/macros/test/CheckTopologies.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#endif
2828

29-
void CheckTopologies(std::string clusfile = "o2clus_its.root", std::string hitfile = "o2sim.root", std::string inputGeom = "O2geometry.root")
29+
void CheckTopologies(std::string clusfile = "o2clus_its.root", std::string hitfile = "o2sim_HitsITS.root", std::string inputGeom = "O2geometry.root")
3030
{
3131
using namespace o2::base;
3232
using namespace o2::its;

Detectors/ITSMFT/ITS/macros/test/CheckTracks.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct DataFrames {
4747
int lastIndex = -1;
4848
};
4949

50-
void CheckTracks(std::string tracfile = "o2trac_its.root", std::string clusfile = "o2clus_its.root", std::string hitfile = "o2sim.root")
50+
void CheckTracks(std::string tracfile = "o2trac_its.root", std::string clusfile = "o2clus_its.root", std::string kinefile = "o2sim_Kine.root")
5151
{
5252
bool filterMultiROFTracks = 1;
5353

@@ -66,7 +66,7 @@ void CheckTracks(std::string tracfile = "o2trac_its.root", std::string clusfile
6666
"ipD:ipZ:label");
6767

6868
// MC tracks
69-
TFile* file0 = TFile::Open(hitfile.data());
69+
TFile* file0 = TFile::Open(kinefile.data());
7070
TTree* mcTree = (TTree*)gFile->Get("o2sim");
7171
mcTree->SetBranchStatus("*", 0); //disable all branches
7272
//mcTree->SetBranchStatus("MCEventHeader.*",1);

Detectors/ITSMFT/ITS/macros/test/DisplayTrack.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "SimulationDataFormat/MCTruthContainer.h"
2727
#endif
2828

29-
void DisplayTrack(Int_t event = 0, Int_t track = 0, std::string tracfile = "o2trac_its.root", std::string clusfile = "o2clus_its.root", std::string hitfile = "o2sim.root", std::string inputGeom = "O2geometry.root")
29+
void DisplayTrack(Int_t event = 0, Int_t track = 0, std::string tracfile = "o2trac_its.root", std::string clusfile = "o2clus_its.root", std::string hitfile = "o2sim_HitsITS.root", std::string inputGeom = "O2geometry.root")
3030
{
3131
using namespace o2::base;
3232
using namespace o2::its;

Detectors/ITSMFT/ITS/macros/test/run_buildTopoDict_its.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/// and mean MC hit position is calculated
3535

3636
void run_buildTopoDict_its(std::string clusfile = "o2clus_its.root",
37-
std::string hitfile = "o2sim.root",
37+
std::string hitfile = "o2sim_HitsITS.root",
3838
std::string inputGeom = "O2geometry.root")
3939
{
4040
const int QEDSourceID = 99; // Clusters from this MC source correspond to QED electrons

Detectors/TOF/prototyping/findTOFclusterFromLabel.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void findTOFclusterFromLabel(int trackID, int eventID = 0, int sourceID = 0)
8787
if (!foundInDigits)
8888
Printf("The label was NEVER found in the digits");
8989

90-
TFile* fKine = new TFile("o2sim.root");
90+
TFile* fKine = new TFile("o2sim_Kine.root");
9191
TTree* tKine = (TTree*)fKine->Get("o2sim");
9292
std::vector<o2::MCTrack>* mcArr = nullptr;
9393
tKine->SetBranchAddress("MCTrack", &mcArr);

0 commit comments

Comments
 (0)