Skip to content

Commit a705103

Browse files
committed
clang fixed
1 parent ffa30ca commit a705103

6 files changed

Lines changed: 183 additions & 144 deletions

File tree

Detectors/FIT/T0/base/src/T0BaseLinkDef.h~HEAD

Lines changed: 0 additions & 19 deletions
This file was deleted.

Detectors/FIT/T0/base/src/T0BaseLinkDef.h~first separation T0 V0

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,90 @@
1-
#if !defined(__CLING__) || defined(__ROOTCLING__)
2-
#include "FITSimulation/Detector.h"
1+
#include "T0Simulation/Detector.h"
32
#include "FITBase/Digit.h"
43
#include <TH2F.h>
5-
#endif
6-
7-
void readHitsDigits()
4+
void readHitsDigits()
85
{
96
using namespace o2::fit;
107
// using namespace o2::fit::Digit;
11-
8+
129
// Create histograms
1310
TDirectory* cwd = gDirectory;
1411
gDirectory = 0x0;
12+
13+
TH2F *hMultHit = new TH2F("hMultHits","photons Hits ",210, 0, 210, 500, 0, 5000);
14+
TH2F *hTimeHitA = new TH2F("hTimeAhit", "Time Hits", 210, 0, 210, 1000, 11, 12);
15+
TH2F *hTimeHitC = new TH2F("hTimeChit", "Time Hits", 210, 0, 210, 1000, 2.8, 3.8);
16+
TH2F *hMultDig = new TH2F("hMultDig","photons Digits ",210, 0, 210, 500, 0, 20);
17+
TH2F *hTimeDig = new TH2F("hTimeDig", "Time Digits", 210, 0, 210, 100, -1, 1);
1518

16-
TH2F* hMultHit = new TH2F("hMultHits", "photons Hits ", 210, 0, 210, 500, 0, 5000);
17-
TH2F* hTimeHit = new TH2F("hTimeAChit", "Time Hits", 210, 0, 210, 1000, 0, 15);
18-
TH2F* hMultDig = new TH2F("hMultDig", "photons Digits ", 210, 0, 210, 500, 0, 20);
19-
TH2F* hTimeDig = new TH2F("hTimeDig", "Time Digits", 210, 0, 210, 300, 0, 15);
20-
21-
gDirectory = cwd;
22-
23-
TFile* fhit = new TFile("o2sim.root");
24-
TTree* hitTree = (TTree*)fhit->Get("o2sim");
25-
std::vector<HitType>* hitArray = nullptr;
26-
hitTree->SetBranchAddress("FITHit", &hitArray);
19+
gDirectory = cwd;
20+
21+
TFile *fhit = new TFile("o2sim.root");
22+
TTree *hitTree = (TTree*)fhit->Get("o2sim");
23+
std::vector<o2::fit::HitType>* hitArray = nullptr;
24+
hitTree->SetBranchAddress("T0Hit", &hitArray);
2725
Int_t nevH = hitTree->GetEntries(); // hits are stored as one event per entry
28-
std::cout << "Found " << nevH << " events with hits " << std::endl;
29-
26+
// std::cout << "Found " << nevH << " events with hits " << std::endl;
27+
3028
Double_t hit_time[240];
3129
Int_t countE[240];
32-
// Event ------------------------- LOOP
33-
for (Int_t ievent = 0; ievent < nevH; ievent++) {
30+
// Event ------------------------- LOOP
31+
for (Int_t ievent=0; ievent<nevH; ievent++){
3432
hitTree->GetEntry(ievent);
35-
for (int ii = 0; ii < 240; ii++) {
36-
countE[ii] = 0;
37-
hit_time[ii] = 0;
38-
}
33+
for (int ii=0; ii<240; ii++) { countE[ii]=0;hit_time[ii]=0; }
3934
for (auto& hit : *hitArray) {
4035
Int_t detID = hit.GetDetectorID();
4136
hit_time[detID] = hit.GetTime();
42-
hTimeHit->Fill(detID, hit_time[detID]);
43-
if (hit_time[detID] < 10 && detID < 96)
44-
std::cout << ievent << " " << detID << " time " << hit_time[detID] << endl;
45-
46-
countE[detID]++;
37+
hTimeHitA -> Fill(detID, hit_time[detID]);
38+
hTimeHitC -> Fill(detID, hit_time[detID]);
39+
countE[detID]++;
4740
}
48-
for (int ii = 0; ii < 208; ii++) {
49-
if (countE[ii] > 100) {
50-
hMultHit->Fill(ii, countE[ii]);
51-
// std::cout<<ii<<" "<<countE[ii]<<endl;
41+
for (int ii=0; ii<208; ii++) {
42+
if (countE[ii]>100) {
43+
hMultHit -> Fill(ii, countE[ii]);
44+
// std::cout<<ii<<" "<<countE[ii]<<endl;
5245
}
5346
}
5447
}
55-
TFile* fdig = TFile::Open("o2sim_digi.root");
48+
49+
TFile* fdig = TFile::Open("t0digits.root");
5650
std::cout << " Open digits file " << std::endl;
5751
TTree* digTree = (TTree*)fdig->Get("o2sim");
58-
o2::fit::Digit* digArr = new Digit;
59-
digTree->SetBranchAddress("FITDigit", &digArr);
52+
std::vector<o2::fit::Digit> * digArr = new std::vector<Digit>;
53+
digTree->SetBranchAddress("T0Digit", &digArr);
6054
Int_t nevD = digTree->GetEntries(); // digits in cont. readout may be grouped as few events per entry
6155
std::cout << "Found " << nevD << " events with digits " << std::endl;
62-
Float_t cfd[208], amp[208];
56+
Float_t cfd[208], amp[208], part[208];
6357
for (Int_t iev = 0; iev < nevD; iev++) {
6458
digTree->GetEvent(iev);
65-
for (int ii = 0; ii < 208; ii++) {
66-
cfd[ii] = amp[ii] = 0;
67-
}
68-
for (const auto& d : digArr->getChDgData()) {
69-
Int_t mcp = d.ChId;
70-
cfd[mcp] = d.CFDTime;
71-
amp[mcp] = d.QTCAmpl;
72-
// cout<<iev<<" "<<mcp<<" "<< cfd[mcp]<<" "<< amp[mcp]<<endl;
73-
hMultDig->Fill(Float_t(mcp), amp[mcp]);
74-
hTimeDig->Fill(Float_t(mcp), cfd[mcp]);
59+
for (const auto& digit : *digArr) {
60+
for (int ii=0; ii<208; ii++) { cfd[ii]=amp[ii]=0; }
61+
Double_t evtime = digit.getTime();
62+
for (const auto& d : digit.getChDgData()) {
63+
Int_t mcp = d.ChId;
64+
cfd[mcp] = d.CFDTime - evtime - 12.5;
65+
amp[mcp] = d.QTCAmpl;
66+
part[mcp] = d.numberOfParticles;
67+
cout<<iev<<" "<<mcp<<" "<< cfd[mcp]<<" "<< amp[mcp]<<" "<<part[mcp]<<endl;
68+
hMultDig ->Fill(Float_t (mcp),amp[mcp]);
69+
hTimeDig ->Fill(Float_t (mcp),cfd[mcp]);
70+
}
7571
}
76-
}
77-
TFile* Hfile = new TFile("FigFit_dig_pp.root", "RECREATE");
72+
}
73+
TFile *Hfile = new TFile("FigFit_hits_pp.root","RECREATE");
7874
printf("Writting histograms to root file \n");
79-
Hfile->cd();
75+
Hfile->cd();
8076
//Create a canvas, set the view range, show histograms
8177
// TCanvas *c1 = new TCanvas("c1","Alice T0 Time ",400,10,600,600);
82-
hTimeHit->Write();
78+
hTimeHitA->Write();
79+
hTimeHitC->Write();
8380
hMultHit->Write();
8481
hTimeDig->Write();
8582
hMultDig->Write();
83+
8684

8785
} // end of macro
86+
87+
88+
89+
90+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#if !defined(__CLING__) || defined(__ROOTCLING__)
2+
#include <Rtypes.h>
3+
#include <TString.h>
4+
#include <TStopwatch.h>
5+
#include <TGeoManager.h>
6+
#include <TFile.h>
7+
#include <TTree.h>
8+
#include <iostream>
9+
10+
#include "FairLogger.h"
11+
12+
#include "T0Reconstruction/CollisionTimeRecoTask.h"
13+
#include "T0Reconstruction/RecPoints.h"
14+
#include "FITBase/Digit.h"
15+
#endif
16+
17+
void run_reco_t0(std::string inpudDig = "t0digits.root",
18+
std::string outName = "o2reco_t0.root",
19+
std::string inputGRP = "o2sim_grp.root") {
20+
21+
// Initialize logger
22+
FairLogger *logger = FairLogger::GetLogger();
23+
logger->SetLogVerbosityLevel("LOW");
24+
logger->SetLogScreenLevel("DEBUG");
25+
26+
// Setup timer
27+
TStopwatch timer;
28+
29+
TFile* fdig = TFile::Open("t0digits.root");
30+
std::cout << " Open digits file " << std::endl;
31+
TTree* digTree = (TTree*)fdig->Get("o2sim");
32+
digTree->Print();
33+
std::vector<o2::fit::Digit> * digits = new std::vector<o2::fit::Digit>;
34+
digTree->SetBranchAddress("T0Digit", &digits);
35+
Int_t nevD = digTree->GetEntries(); // digits in cont. readout may be grouped as few events per entry
36+
std::cout << "Found " << nevD << " events with digits " << std::endl;
37+
38+
//std::vector<o2::fit::RecPoints> recPoints;
39+
std::vector<o2::t0::RecPoints>* recPointsP = new std::vector<o2::t0::RecPoints>;
40+
41+
TFile outFile(outName.c_str(),"recreate");
42+
TTree outTree("o2sim", "T0RecPoints");
43+
outTree.Branch("T0Cluster", &recPointsP);
44+
45+
o2::t0::CollisionTimeRecoTask recoFIT;
46+
timer.Start();
47+
for (int iEv=0; iEv<nevD; iEv++) {
48+
digTree->GetEntry(iEv);
49+
recPointsP->resize(digits->size());
50+
for (size_t collID=0; collID < digits->size(); ++collID)
51+
recoFIT.Process((*digits)[collID], (*recPointsP)[collID]);
52+
outTree.Fill();
53+
}
54+
55+
outTree.Print();
56+
outFile.ls();
57+
timer.Stop();
58+
outTree.Write();
59+
Double_t rtime = timer.RealTime();
60+
Double_t ctime = timer.CpuTime();
61+
62+
Float_t cpuUsage=ctime/rtime;
63+
std::cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
64+
std::cout << cpuUsage;
65+
std::cout << "</DartMeasurement>" << std::endl;
66+
std::cout << "Macro finished succesfully." << std::endl;
67+
68+
std::cout << "Real time " << rtime << " s, CPU time " << ctime
69+
<< "s" << std::endl << std::endl;
70+
71+
}

Detectors/FIT/V0/base/src/Geometry.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void Geometry::buildGeometry(){
8282
}
8383

8484
TGeoVolumeAssembly* Geometry::buildSector(uint16_t iSector){
85-
new TGeoBBox("boolBoxScintSeparator", mvrMaxScint.at(mvrMaxScint.size()-1), sDySeparationScint*2, sDzScint+sEpsilon);
85+
new TGeoBBox("boolBoxScintSeparator", mvrMaxScint.at(mvrMaxScint.size() - 1), sDySeparationScint * 2, sDzScint + sEpsilon);
8686

8787
std::stringstream ssName;
8888
ssName << "sector" << iSector+1;
@@ -101,7 +101,7 @@ TGeoVolumeAssembly* Geometry::buildSector(uint16_t iSector){
101101
TGeoCompositeShape* geoCell = new TGeoCompositeShape(ssNameGeoComposite.str().c_str(), booleanFormula.c_str());
102102

103103
TGeoMedium* kMed = gGeoManager->GetMedium("V0_Scintillator$");
104-
TGeoVolume *volCell = new TGeoVolume("V0cell", geoCell, kMed);
104+
TGeoVolume* volCell = new TGeoVolume("V0cell", geoCell, kMed);
105105

106106
volCell->SetLineColor(kYellow);
107107
sector->AddNode(volCell, iCell+1);

0 commit comments

Comments
 (0)